Seamless video looping
Categories
(Core :: Audio/Video: Playback, enhancement, P2)
Tracking
()
People
(Reporter: limeclipse, Assigned: alwu)
References
(Depends on 2 open bugs, Blocks 2 open bugs, Regressed 1 open bug)
Details
Attachments
(20 files)
470.22 KB,
video/webm
|
Details | |
234 bytes,
text/html
|
Details | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0 Build ID: 20160315153207 Steps to reproduce: Encoded a VP9 video (no audio source) in a WebM container and used the <video> tag with loop & autoplay attributes to play it in Firefox. Actual results: While the video itself is a seamless loop, the playback in Firefox is not. There is a noticable skip from the end to the beginning of the video. This happens with all kinds of configurations: CBR, ABR, BVR, 25 const FPS, 30 const FPS, and even with the OGG/Theora combination. This does NOT happen with MPeG4/MP4 configuration. Expected results: It should be a seamless loop. Other browsers do not have this issue.
Updated•8 years ago
|
(In reply to Loic from comment #2) > I don't see a noticable skip between end and beginning on my side. That could be related to machine performance. I think the issue is that we don't support seamless looping.
Updated•8 years ago
|
Mass change P2 -> P3
Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
People are using videos a lot more often for things that used to be GIFs (finally!), but this bug makes things painful on Firefox. It would be great if we could raise the priority here. I see looping jank on Linux, Android, and Windows.
Assignee | ||
Comment 6•3 years ago
|
||
Because our resource is limited. Before we implement this, I would like to add some telemetry probes to see how many video are used in that, comparing with non-looping video playback.
Reporter | ||
Comment 7•2 years ago
|
||
Got reminded of this issue due to an e-mail. Here to report that the issue is no longer present (fixed). It must have happened quite some time ago, but my current version is 103.0.2.
Updated•2 years ago
|
Comment 8•2 years ago
|
||
FYI we're tracking the Meet issue here - Bug 1789881 - Google Meet background video experiences black frame or stutter at video loop point
Updated•2 years ago
|
Assignee | ||
Comment 9•2 years ago
|
||
Assignee | ||
Comment 10•2 years ago
|
||
Depends on D159125
Assignee | ||
Comment 11•2 years ago
|
||
Depends on D159126
Assignee | ||
Comment 12•2 years ago
|
||
Depends on D159127
Assignee | ||
Comment 13•2 years ago
|
||
Depends on D159128
Assignee | ||
Comment 14•2 years ago
|
||
If the video looping is not seamless, when playback reaches to the end,
MDSM would trigger a seek in order to get the new frame from the start
position. That would notify the media element that the status of the next
frame is not available now due to seeking (NEXT_FRAME_UNAVAILABLE_SEEKING)
and causes the media element dispatching waiting
event.
Above situaion shouldn't happen when we're in the seamless looping. The
added test covers that situation.
That ready state change also causes the google meet issue [1], because
the spec only allows capturing an image from a media element if it's
ready state is at least in HAVE_CURRENT_DATA
.
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1789881#c3
Depends on D159217
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 16•2 years ago
|
||
This behavior is optional [1] and currently this test only passes on
Edge [2].
The reason of becoming timeout is because seamless looping now won't
change the media element's ready state. When looping is seamless,
element's ready state will change below HAVE_CURRENT_DATA (like what I
describe in D159218), and when we have enough data (HAVE_FUTURE_DATA or
HAVE_ENOUGH_DATA) the element would dispatch playing
which causes the
condition check failure [3].
As now we're using seamless looping, now playing
event will be resent
which causes the timeout.
[1] https://html.spec.whatwg.org/multipage/media.html#ready-states:eligible-for-autoplay-2
[2] https://wpt.fyi/results/html/semantics/embedded-content/media-elements/ready-states/autoplay-hidden.optional.html?label=experimental&view=subtest
[3] https://searchfox.org/mozilla-central/rev/76ccfc801e6b736c844cde3fddeab7a748fc8515/testing/web-platform/tests/html/semantics/embedded-content/media-elements/ready-states/autoplay-hidden.optional.html#27
Depends on D159218
Assignee | ||
Comment 17•2 years ago
|
||
This test ensures that we can always capture correct video frame via
canvas.
The black frame issue was discoverd in bug 1789881, where the canvas
capture is racing with the media element state change [1], which results
in capturing a black frame.
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1789881#c3
Depends on D159333
Assignee | ||
Comment 18•2 years ago
|
||
As we need some time to ensure that they can work well, so these patches will be targeting on Fx108.
Assignee | ||
Updated•2 years ago
|
Comment 19•2 years ago
|
||
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/70bc7e69d03a part1 : generalize the request data function in order to support requesting video data as well. r=padenot https://hg.mozilla.org/integration/autoland/rev/7d876e0ef72a part2 : support seamless video looping. r=padenot https://hg.mozilla.org/integration/autoland/rev/72a9ff64ef1b part3 : allow the format reader to request video data during audio seeking. r=padenot https://hg.mozilla.org/integration/autoland/rev/4724dd3b433f part4 : add more debug logs. r=padenot https://hg.mozilla.org/integration/autoland/rev/143255ae75ed part5 : only seek one track at a time otherwise the previous seek target would be overwritten. r=padenot https://hg.mozilla.org/integration/autoland/rev/c937297d3874 part6 : add a test to ensure that media element always has current frame during seamless looping. r=padenot https://hg.mozilla.org/integration/autoland/rev/92e2db60f44a part7 : change the expectation of 'autoplay-hidden.optional.html.ini' from `Failed` to `Timeout`. r=padenot https://hg.mozilla.org/integration/autoland/rev/0e8e7d877d08 part8 : add a canvas test to ensure that video is seamless looping. r=padenot
Comment 20•2 years ago
|
||
Backed out 8 changesets (Bug 1262276) for causing failures in MediaDecoderStateMachine.cpp CLOSED TREE
Log: https://treeherder.mozilla.org/logviewer?job_id=393432218&repo=autoland&lineNumber=5475
Backout: https://hg.mozilla.org/integration/autoland/rev/20834bcffa8ef65a1848a13239df5438dfe3b9f3
Comment 21•2 years ago
|
||
And also mda failures: https://treeherder.mozilla.org/logviewer?job_id=393432096&repo=autoland
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 22•2 years ago
|
||
Assignee | ||
Comment 23•2 years ago
|
||
We don't want to trigger skip-to-next-keyframe after reaching video
EOS. Because now we've reset the demuxer to 0, and are going to request
data from start.
If playback hasn't looped back, the media time would still be too large,
which makes the reader think the playback is way behind and performs
nonecessary skipping which causes stutter.
Eg. Media is 10s long, reaching EOS at 8s, requesting data at 9s.
Assume media's keyframe interval is 3s, which means keyframes will
appear on 0s, 3s, 6s and 9s.
If we uses current media time as a threshold, the reader sees the next
key frame is 3s but the threashold is 9s, which usually happens when
the decoding is too slow.
But that is not the case for us, we should by pass the
skip-to-next-keyframe logic until the media loops back.
Depends on D160159
Assignee | ||
Comment 24•2 years ago
|
||
For pretty short media, (eg. gizmo-short.mp4), after reaching audio EOS,
the next audio sampe would be put on waiting because we can't adjust its
timestamp yet.
If so, we should stop prerolling otherwise the playback would never stop
because we won't ask for more audio data when there is always a data on
waiting.
Depends on D160160
Assignee | ||
Comment 25•2 years ago
|
||
This patch includes different test cases which caused problems before
during the development, and they are all some basic behavior tests.
Depends on D160163
Assignee | ||
Comment 26•2 years ago
|
||
When leaving looping state to another state, media data stored in the
media queue are already adjusted. If the new state requests a new data
but doesn't adjust its timestamp, then the data in the media queue will
be out of order.
If that happens on video data, it would causes a/v unsync and the video
frame would be discarded because it doesn't catch up with the clock
time, which might have grown a lot via looping multiple times.
The example transitions from the looping state which would encounter
this situation are buffering state (decoding too slow), decoding state
(cancel looping) and video only seek (bkg video resume).
In the premise of letting the clock time keep growing, we would need to
put the offset to somewhere independent to states. Therefore, we choose
to let the media queue do the task of the timestamp adjustment.
So even if we leave the looping state, the new coming data would be
adjusted their timestamp correctly and match the clock time. If we enter
the looping state again, we can also smoothly keep adding more offset to
all future data.
Depends on D160163
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 27•2 years ago
|
||
When requesting data from demuxer, it should always use normalized data,
which is within [0, original-track-duration]. So we need to adjust seek
target time in order not to use clock time which has grown over the
duration due to multiple times of looping (that time is larger than
duration).
Depends on D160164
Assignee | ||
Comment 28•2 years ago
|
||
Using mozPresentedFrames
is incorrect, because that represents how
many frames the video sink sends to the compositor, and that can include
the same frame multiple time. [1]
Due to the seamless looping, now we could have more frames in the video
queue, so mozPresentedFrames
could be much larger than the actual
frames already be rendered. Therefore, we should use mozPaintedFrames
instead, which is closer to the situation we wanted to measure (submit
native layer to screen)
This patch also increases the playback rate and the threshold in the
test in order to reduce test running time.
Depends on D160699
Assignee | ||
Comment 29•2 years ago
|
||
Per offline discussion with Kesley, we decided to disable seamless
looping for these tests first, and then spend time to figure the gfx
side crash due to not be able to manage texture's lifetime correctly.
Depends on D160700
Assignee | ||
Comment 30•2 years ago
|
||
This doesn't work for seamless looping because the video end time can
be larger than the media time. We would need to revisit these mechaniam
later to see if we can have a better way to skip to next frame.
Depends on D160701
Assignee | ||
Comment 31•2 years ago
|
||
Depends on D160864
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 32•2 years ago
|
||
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1df4774b2c53 part1 : generalize the request data function in order to support requesting video data as well. r=padenot https://hg.mozilla.org/integration/autoland/rev/3e647187e78b part2 : support seamless video looping. r=padenot https://hg.mozilla.org/integration/autoland/rev/f6c98cf1d45f part3 : allow the format reader to request video data during audio seeking. r=padenot https://hg.mozilla.org/integration/autoland/rev/6672431765dc part4 : add more debug logs. r=padenot https://hg.mozilla.org/integration/autoland/rev/1dd4093cd374 part5 : only seek one track at a time otherwise the previous seek target would be overwritten. r=padenot https://hg.mozilla.org/integration/autoland/rev/55e490e2de4c part6 : add a test to ensure that media element always has current frame during seamless looping. r=padenot https://hg.mozilla.org/integration/autoland/rev/1dac017b6089 part7 : change the expectation of 'autoplay-hidden.optional.html.ini' from `Failed` to `Timeout`. r=padenot https://hg.mozilla.org/integration/autoland/rev/e807704e1c9b part8 : add a canvas test to ensure that video is seamless looping. r=padenot https://hg.mozilla.org/integration/autoland/rev/d122b10f03ad part9 : don't adjust looping timestamp until the longest track duration is known. r=padenot https://hg.mozilla.org/integration/autoland/rev/abd21243cfda part10 : bypass skip to the next frame until media loops back. r=padenot https://hg.mozilla.org/integration/autoland/rev/44e50217fdc9 part11 : stop prerolling if the track data is waiting for the timestamp adjustment. r=padenot https://hg.mozilla.org/integration/autoland/rev/e43f99440e29 part12 : store looping offset in the media queue in order to keep timestamp consistantly increasing across different states. r=padenot https://hg.mozilla.org/integration/autoland/rev/12aaeb776da1 part13 : add more tests for seamless looping. r=padenot https://hg.mozilla.org/integration/autoland/rev/9e9f7deff834 part14 : video-only seek should use original time as a seek target. r=padenot https://hg.mozilla.org/integration/autoland/rev/b1a5972d0cee part15 : disable seamless looping for test_video_low_power_telemetry.html in order to fix the test failure. r=padenot https://hg.mozilla.org/integration/autoland/rev/ee73611a2993 part16 : disable seamless looping for webgl-conf test. r=jgilbert https://hg.mozilla.org/integration/autoland/rev/f436cf1a01cc part17 : disable late time check for seamless looping. r=padenot https://hg.mozilla.org/integration/autoland/rev/1d0656c6185d part18 : add a pref to control video seamless looping. r=padenot
Comment 33•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1df4774b2c53
https://hg.mozilla.org/mozilla-central/rev/3e647187e78b
https://hg.mozilla.org/mozilla-central/rev/f6c98cf1d45f
https://hg.mozilla.org/mozilla-central/rev/6672431765dc
https://hg.mozilla.org/mozilla-central/rev/1dd4093cd374
https://hg.mozilla.org/mozilla-central/rev/55e490e2de4c
https://hg.mozilla.org/mozilla-central/rev/1dac017b6089
https://hg.mozilla.org/mozilla-central/rev/e807704e1c9b
https://hg.mozilla.org/mozilla-central/rev/d122b10f03ad
https://hg.mozilla.org/mozilla-central/rev/abd21243cfda
https://hg.mozilla.org/mozilla-central/rev/44e50217fdc9
https://hg.mozilla.org/mozilla-central/rev/e43f99440e29
https://hg.mozilla.org/mozilla-central/rev/12aaeb776da1
https://hg.mozilla.org/mozilla-central/rev/9e9f7deff834
https://hg.mozilla.org/mozilla-central/rev/b1a5972d0cee
https://hg.mozilla.org/mozilla-central/rev/ee73611a2993
https://hg.mozilla.org/mozilla-central/rev/f436cf1a01cc
https://hg.mozilla.org/mozilla-central/rev/1d0656c6185d
Assignee | ||
Updated•1 year ago
|
Updated•10 months ago
|
Description
•