Over the past while, Firefox has an issue with HTML5 video playback on YouTube that affects some computers where sections of video appears with frames played out of sequence, resulting in erratic playback as it occurs. With faster hardware, this issue may only occur once every hour or two of playback, if at all. On some other computers such as my ageing workplace PC, this issue occurs in just about every YouTube video played on Firefox, rendering it unwatchable. Based on checking with other people that ran into this problem, this mainly affects PCs running Windows 8 and 10 with an Nvidia or Intel graphics GPU. Chrome, Internet Explorer and Edge don’t appear to be affected.
Going by this bug report on Mozilla, one workaround is enter ‘about:config’ into the address bar and create a new Boolean key “media.windows-media-foundation.allow-d3d11-dxva”, set to ‘True’. On my workplace PC that is worst affected, the erratic playback still occurs but doesn’t seem as severe as beforehand. With my home PC, the erratic playback still runs for a few seconds each time it occurs.
As I went to try making a screen recording of this issue, this issue would not occur no matter how many times I tried recording the screen. To rule out the screen capture software, I then recorded the video using my phone, but ended up with the same outcome where the video played fine even on my workplace PC. I then realised that each time I selected ‘1080p’ mode to ensure YouTube stayed in 1080p through my recording, this actually prevented the issue occurring.
After trying a fair number of videos on my workplace PC including 1080p 60FPS, just simply selecting a video mode prevents the glitches occurring during playback, even if the chosen mode is already what YouTube automatically selected. So if the Internet connection has sufficient bandwidth to play 1080p without periodic buffering, set YouTube to 1080p.
The following is a demonstration showing how this issue occurs for the first 15 seconds of playback until I set the playback mode to ‘1080p’, even though YouTube was already playing in 1080p from the start. This is best viewed using Chrome or Internet Explorer which doesn’t present this issue:
This PC at my workplace is running Windows 8.1 32-bit and has a very basic Nvidia GeForce 210 graphics adapter. Firefox 45.0.1 was used in this demonstration. The focus hunting is due to the OnePlus Two phone’s camera app lacking the ability to lock the focus.
So until Firefox fixes this issue, the main workaround work that consistently works at least for us is to manually select a suitable video resolution (e.g. ‘1080p’) at the start of every YouTube video.
Update: From further checking on my home Windows 10 PC, the boolean key mentioned in the second paragraph needs to be added for the second workaround to also have any effect, at least with Firefox running on Windows 10 64-bit.