Closed Bug 1233815 Opened 9 years ago Closed 9 years ago

HTML5 video playback presents frames out of order under certain scenarios

Categories

(Core :: Audio/Video: Playback, defect, P1)

45 Branch
Unspecified
Windows
defect

Tracking

()

RESOLVED DUPLICATE of bug 1236112

People

(Reporter: kael, Unassigned)

References

Details

Attachments

(1 file)

Over the past couple months I've noticed that HTML5 video playback in Firefox now presents frames out of order in certain scenarios. The way this is observed is that periodically an old frame will appear for a vsync where a new frame should have appeared, causing the video to appear to leap backwards or glitch momentarily. The issue has persisted across a machine reformat/reinstall, GPU swap (970 to 980ti), monitor replacements, video driver updates, and many developer channel updates, so I decided to report it. Unfortunately, I can't provide any footage of the issue, because attempting to do any sort of screen recording subtly influences timings such that the issue goes away. I've previously observed this same bug in the madVR video compositor for media players, and in that case it only occurs in certain presentation configurations and not others. I've yet to observe this bug in any other software. The most precise way to describe this glitch is that the DWM compositor appears to be running out of frames in the ring-buffer and presenting the oldest frame in the ring buffer instead of waiting for a new one. Whatever timing influences this appears to drift in and out of sync, such that I might see it reproduce for a couple seconds at a time or entire minutes, but then things go back to normal. In madVR the glitch was only present when it queued frames up to the compositor to present (DWM, I'm pretty sure), but not when it used D3D swap chains. You could vary how frequent the glitch would be by adjusting the size of its DWM present queue (an option in the filter), where a queue depth of 3 caused REALLY FREQUENT frame errors when the bug was occurring (basically every 3 or 4 frames). Firefox's glitches appear equivalent here, but I have no way to turn any knobs :-) I would try turning off composition to see if the bug goes away, but you can't turn off composition anymore in D3D10. Are there a specific about:config prefs I can flip to see if that affects things and narrow anything down? about:support gfx info follows ---- Application Basics ------------------ Name: Firefox Version: 45.0a2 Build ID: 20151218004007 Update Channel: aurora User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0 Multiprocess Windows: 0/2 (default: false) Safe Mode: false Graphics -------- Adapter Description: NVIDIA GeForce GTX 980 Ti Adapter Drivers: nvd3dumx,nvwgf2umx,nvwgf2umx,nvwgf2umx nvd3dum,nvwgf2um,nvwgf2um,nvwgf2um Adapter RAM: 4095 Asynchronous Pan/Zoom: none Device ID: 0x17c8 Direct2D Enabled: true DirectWrite Enabled: true (10.0.10586.0) Driver Date: 11-24-2015 Driver Version: 10.18.13.5906 GPU #2 Active: false GPU Accelerated Windows: 2/2 Direct3D 11 (OMTC) Subsys ID: 19963842 Supports Hardware H264 Decoding: Yes Vendor ID: 0x10de WebGL Renderer: Google Inc. -- ANGLE (NVIDIA GeForce GTX 980 Ti Direct3D11 vs_5_0 ps_5_0) windowLayerManagerRemote: true AzureCanvasBackend: direct2d 1.1 AzureContentBackend: direct2d 1.1 AzureFallbackCanvasBackend: cairo AzureSkiaAccelerated: 0 Important Modified Preferences ------------------------------ gfx.crash-guard.d3d11layers.appVersion: 45.0a2 gfx.crash-guard.d3d11layers.deviceID: 0x17c8 gfx.crash-guard.d3d11layers.driverVersion: 10.18.13.5906 gfx.crash-guard.d3d11layers.feature-d2d: true gfx.crash-guard.d3d11layers.feature-d3d11: true gfx.crash-guard.glcontext.gfx.driver-init.direct3d11-angle: true gfx.crash-guard.glcontext.gfx.driver-init.webgl-angle: true gfx.crash-guard.glcontext.gfx.driver-init.webgl-angle-force-d3d11: false gfx.crash-guard.glcontext.gfx.driver-init.webgl-angle-force-warp: false gfx.crash-guard.glcontext.gfx.driver-init.webgl-angle-try-d3d11: true gfx.crash-guard.status.d3d11layers: 2 gfx.crash-guard.status.d3d9video: 2 gfx.crash-guard.status.glcontext: 2 gfx.direct3d.last_used_feature_level_idx: 0 gfx.driver-init.appVersion: 42.0a2 gfx.driver-init.deviceID: 0x17c8 gfx.driver-init.driverVersion: 10.18.13.5582 gfx.driver-init.feature-d2d: true gfx.driver-init.feature-d3d11: true gfx.driver-init.status: 2 gfx.font_rendering.cleartype_params.cleartype_level: 40 gfx.font_rendering.cleartype_params.force_gdi_classic_for_families: gfx.font_rendering.directwrite.enabled: true media.gmp-eme-adobe.abi: x86_64-msvc-x64 media.gmp-eme-adobe.lastUpdate: 1446729582 media.gmp-eme-adobe.version: 16 media.gmp-gmpopenh264.abi: x86_64-msvc-x64 media.gmp-gmpopenh264.lastUpdate: 1447436855 media.gmp-gmpopenh264.version: 1.5.1 media.gmp-manager.buildID: 20151218004007 media.gmp-manager.lastCheck: 1450467062 media.hardware-video-decoding.failed: false
Sounds like we have some kind of race here. Can you share a video url which reproduces the problem so we can control for encoding issues? You could try turning off hardware decoding? Set media.hardware-video-decoding.enabled to false in about:config.
Flags: needinfo?(kg)
It would be nice to fix this. We should order a matching card and see if we can reproduce. Also, if you could film the out-of-order playback (screenrecord or on your phone) and attach the video, that will help us figure this out and make sure we're reproducing the same issue.
Flags: needinfo?(giles)
Priority: -- → P1
Jeff - do you have one of these GPUs in Toronto?
Flags: needinfo?(jmuizelaar)
It occurs on literally every html5 video I watch. Youtube, pretty much anything. It does seem to come and go in a way that makes sense for a timing issue - sometimes dozens to hundreds of glitches in the span of a few minutes, sometimes it's fine for a little while. But it's very consistent. I have not observed this with flash player or with html5 canvas, just to rule those out. So it doesn't seem like a general rendering issue, it's limited to <video> playback as far as I can tell. I'll test turning off hw decoding and see what happens, once I get a recording from my phone.
Though now that I say that, I can't reproduce the bug right now. I'll probably need to use my machine for a bit before it starts happening again... I still haven't figured out what causes it to come and go. I sent an email out to the author of madVR, because he previously had this same bug, identified it, and fixed it (it's in his changelogs, and the update made it go away on my machine). Ideally he will explain what's up and then I can use that to narrow down repro steps that will work.
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #3) > Jeff - do you have one of these GPUs in Toronto? No. But we should probably get something like one.
Flags: needinfo?(jmuizelaar)
I haven't been able to get things into a really nasty state over the last week or so, but I do see the glitch periodically. It might have something to do with the nature of the video content (size? framerate? encoder?) but I don't know. I was watching some footage of a recent video game ( https://www.youtube.com/watch?v=LPzT8fPvoG0 ) and noticed a handful of single frame glitches that were obvious, in part because the footage is 30fps. Viewing the video in Edge or Chrome shows no glitches there, they only occur when viewing it in Firefox. I recorded my screen using my phone's 120fps video mode and then cropped out a few really obvious ordering errors where an old frame made an appearance. In this attachment you can see that when the player character grabs the NPC's arm and starts to pull on it, there's a momentary glitch where the arm snaps back into its original position and the minimap rotates in the wrong direction. This is an old frame. Immediately after that the correct frame appears. I can't tell whether it's showing an incorrect frame for one desktop refresh (60hz) or for one entire video frame (30hz). Frame-counting could probably answer that question.
Flags: needinfo?(kg)
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
bug 1236112 is fullscreen only, this occurs in all html5 videos regardless of playback mode.
Flags: needinfo?(ajones)
I'm confident that they are the same root cause.
Flags: needinfo?(ajones)
Flags: needinfo?(giles)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: