-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seeking should start playing immediately from closest video Key-frame, or are we missing something? #179
Comments
If the buffer is local, perhaps it would be better if the player 'pre-rolled' from the closest preceeding I-frame, and then started playback from the requested time? |
This picked my curiosity.. how could you seek any differently? When seeking, AFAIK, you always find the first keyframe preceding seek time and start decoding from there. |
Yes, this is quite obvious, so I cannot explain why Chrome, IE and Edge have this issue. JY, Firefox seeks just fine with these two demo streams. Waiting on input from Chrome and Edge people. |
David Singer: thanks for participating in this discussion. Could you please tell us - are there any plans by Apple to support MSE on iOS? The above two streams would play absolutely everywhere except browsers on iOS. |
alas, I am formally constrained from making promises or announcements....sorry |
#179 (comment) describes Chrome's behavior.
Solution:
If your stream were audio/video, it would be much more apparent that audio would begin playing immediately post-seek, while video would vary the post-seek playback start depending on the PTS interval between the seek target and the next actual key frame after the incorrectly marked keyframe at or preceding the seek target time. I should note that not all media engines behave well when starting decode at a non-keyframe. It is thus important to correctly mark your keyframes in the bytestream. (Correction: almost every frame is marked as keyframe. In a 10 second clip from that repro link, only 1 wasn't marked as a keyframe.) |
FWIW, since Firefox bug 1300296 (https://bugzilla.mozilla.org/show_bug.cgi?id=1300296); we've stopped relying on the container's keyframe flag. Instead we look at the H264 bytestream and look for I-frame and only rely on this information to consider if a frame is a keyframe or not. |
Of course. And frames are marked correctly in the bytestream indeed. They are marked incorrectly at the mp4 container's flag, and apparently Chrome and Edge rely on the container flag. So, of course, it seems to us that Firefox's approach is the correct one, but we will not argue much. It is an easy fix for us to provide the correct value in the container, and that's what we will do. |
Firefox is recovering from a bad file, but indeed, don't make bad files in the first place... |
Chrome and Edge both have this issue: when a user seeks in a local buffered range, the playback sometimes continues from video p-frame; sometimes video freezes for 1-2 sec until a key-frame is reached.
Please take a look at these two live streams:
http://umediaserver.net/umediaserver/demohtml5player.html
http://umediaserver.net/umediaserver/demoiptvhtml5.html
While playing, try to seek in a local buffer (it contains 1 minute of latest content) and you will see the issue. Both of these streams have Key-frame frequency of 3-4 seconds. It seems like when the player seeks by setting video.currentTime = value, then the player picks a frame at this exact commanded value, even if it is a p-frame. So you either start playing from p-frame or wait until playback reaches key-frame.
Why the player is not jumping to the closest key-frame to start playing from there?
Thank you.
UMedia team
The text was updated successfully, but these errors were encountered: