Open Bug 1885795 Opened 2 years ago Updated 4 months ago

Youtube video crashes when skipping time

Categories

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

Firefox 124
Desktop
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: gaudet.eric, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0

Steps to reproduce:

Play youtube video, click on the time bar to skip ahead, or used the right arrow key a few times to skip ahead.

A few notes:

  • video should be long enough that it's not buffered fully
  • happens on many videos
  • same videos played in different browsers (freetube) do not have this problem
  • started to happen in Firefox 124.0, previous version did not have this problem
  • also noticed that the video is stuttering a lot in this version, might be related with this bug

User agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0

Actual results:

The player shows a spinner, then crashes, displaying an error message like: "An error occurred. Please try again later. (Playback ID: c8ytAuMl_kpFdwZj) Learn More"

Console showed this error message when this happens:
[Child 3706869, MediaDecoderStateMachine #1] WARNING: Decoder=7fe938508700 Decode error: NS_ERROR_DOM_MEDIA_DECODE_ERR (0x806e0004) - virtual void mozilla::GMPVideoDecoder::Error(GMPErr): GMPErr:7: file /build/firefox-kw8s2o/firefox-124.0+build1/dom/media/MediaDecoderStateMachineBase.cpp:166

Expected results:

Player resumes the video at the requested timestamp.

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

Odd that this is passing through the gmp code, as that's only used for encrypted video and occasionally H264. Youtube however generally uses VP9. Do you have a link to the video in question?

Flags: needinfo?(gaudet.eric)

Almost all videos do it. Here's an example https://www.youtube.com/watch?v=Ib0m5mEtGCY
I also noticed that videos might crash the same way when switching tabs fast or closing multiple times when a video is playing, if that helps.

Flags: needinfo?(gaudet.eric)

Yeah, it's really annoying, forces me more and more to use Chrome for watching Youtube content since that 124 update came in (Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0).

Here, the latest "black screen" failure occured, when an in-video-commercial ended and the video was to be continued. But it also happens when skipping ahead and so on.

The console shows a couple of warnings:

Medien-Ressource blob:https://www.youtube.com/f171a3c5-8342-4f3d-8238-8e9443f10e6c konnte nicht dekodiert werden. 

This error message will be blank when privacy.resistFingerprinting = true.  
If it is really necessary, please add it to the whitelist in MediaError::GetMessage: NS_ERROR_DOM_MEDIA_DECODE_ERR (0x806e0004) - 
virtual void mozilla::GMPVideoDecoder::Error(GMPErr): GMPErr:7 3 base.js:11051:19

WEBGL_debug_renderer_info is deprecated in Firefox and will be removed. Please use RENDERER. base.js:11741:566

It should be easy to reproduce this with any YT video. Maybe it's just a Linux thing, otherwise I'd consider this a major issue for Firefox…

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jmathies)

Disabling gfx.direct3d11.reuse-decoder-device as suggested in bug 1887942 seems to help.

Okay, it does help, but it doesn't fix it. With gfx.direct3d11.reuse-decoder-device enabled, the black error screen appears all the time. Without, Youtube is at least kind of usable again.

Disabling gfx.direct3d11.reuse-decoder-device does seem to fix the constant crashing. It does not change the video stuttering, which it still does all the time (several times per seconds it skips back a few frames).

Actually I still do see occasional crashes if I switch tabs while a video is playing, but much less than before.

I updated to Firefox 125.0 (Ubuntu 22.04 Snap) about 2 days ago, and I've had the same issue since.

It seems to happen randomly on some videos. Or perhaps following some yet-unknown trigger-action I take on any video.

Here's an example where it happens for me: https://www.youtube.com/watch?v=crtQSTYWtqE -- I need only start the video and then skip, say, 2 minutes in, and it stalls for a few seconds before showing "An error occurred ...".

No matter how many times I refresh the tab or restart Firefox or wipe my Youtube cookies, the issue persists for this video.

I can watch the same video without problems with Brave.

I've just tried the suggested workaround (gfx.direct3d11.reuse-decoder-device = False in about:config) and the issue initially seemed to be fixed for that video. I skipped ahead to 2 mins and the playback nicely continued immediately.

Then I let it keep playing from that spot, and after maybe 15s, the video stalled and raised the error again :-(

Subsequent attempts to play the same video did not reproduce even that slight improvement -- upon any skip, the video stalls indefinitely just the same as before the workaround, and if I do a Play/Pause to try and get it going, the Youtube error pops up. Restarting Firefox changed nothing.

(PS: Even skipping within the buffered video interval, yields the same problem, so I don't need to skip as far as 2 mins.
The Play/Pause is a step that's sometimes needed during the stall, to cause the Youtube error to pop up -- I just forgot to mention it in my previous comment.)

Aside from the fatal stall-on-seek issue, there are other issues, likely lesser signs of the same main issue:

  • videos stuttering every few seconds, whether you seek or not
  • on every video, each seek takes much longer that usual to resume playing, and since I worry each time that this seek will be the fatal last, I don't dare use the Left/Right seek buttons more than once at a time

I use Youtube too much to continue like this, so I decided to just revert to my previous version 121.0. So far, I can no longer reproduce the issue, seeking is quick and painless as usual.

For anyone interested, using Ubuntu snaps:

  • Use snap list --all firefox to see all the available versions cached by snap on your machine (as I understand it). If you have a version older than 124.0, there may yet be hope for you.
  • Check about:profiles to see the location of your profile data (typically in ~/snap/firefox/common/.mozilla/firefox), and back it all up someplace else. The revert normally shouldn't affect your data, but Firefox and Ubuntu can be funny about these things.
  • sudo snap revert firefox to revert it to your previous version, before the latest refresh/update -- assuming you only noticed this issue after your latest update. (If desired, this command can accept specific revisions, see the help.)
  • When you attempt to launch Firefox after the reversal, you'll get a persistent dialog telling you to create a new profile since you're using an older version etc. etc. Quit that dialog and instead launch Firefox from the command line with firefox --allow-downgrade. Firefox should run and load your profile as usual.
  • Going forward, you should be able to quit Firefox and re-launch it normally, without needing the command line switch.
  • You may want to suspend further Firefox refreshes/updates with sudo snap refresh --hold firefox, until whenever this issue is fixed.

Hopefully, the hold will be a short one.

Excerpt from this reddit thread where others have reported the same issue:

Apparently video codecs somehow stopped working - in about:support most of them showed "Unsupported" - now everything is "Supported" except HEVC.

Hoping this provides clues to anyone investigating the issue, to reach a root cause.

Flags: needinfo?(jmathies)
OS: Unspecified → Linux
Hardware: Unspecified → Desktop

Could you help us out by trying to capture a Firefox performance profile when this happens? Visit https://profiler.firefox.com/ for more information and to enable the profiling toolbar button. When capturing, please select the Media profile in the button drop down, upload the resulting profile and post the url here.

Sorry, this is all on my personal machine, I've just managed to get it all working again, and not too keen on reversing all that, especially when snap may not easily allow me to return to v121 again.

Perhaps someone else on the thread has a setup that can run your test?

I temporarily re-enabled gfx.direct3d11.reuse-decoder-device, and played this video: https://www.youtube.com/watch?v=D8EIs8s303k
I let it play a few seconds, then skipped to 120s by clicking on the time bar. The video player crashed without playing although the time bar displayed a little bit of buffering before crashing.
Here's the media profile as requested: https://profiler.firefox.com/public/smex0h176gxhewfs6zyg6110xzve6zy04vesyyr/calltree/?globalTrackOrder=0w4&thread=8&v=10
(Also please note that the video images are stuttering, but the audio is fine)

Profile on another video with gfx.direct3d11.reuse-decoder-device disabled: no crashing but a lot of stuttering (no seeking)
https://profiler.firefox.com/public/5j0z3xhq31645128aqbb6k20tfs5w7174rcw7b8/calltree/?globalTrackOrder=0w3&hiddenLocalTracksByPid=713368-1~713577-23~716240-1~717130-5&thread=6&v=10

Hi @Jim, any updates on this ticket/issue? Some of us are still stuck on v121 ...

Anyone looking into this? :jimm?

The issue happens much more if the youtube video plays in one tab and you switch tabs. If the video tab is in a separate window it seems to play fine as long as you don't seek. Hope this helps reproduce the issue, because it's incredibly annoying and makes browsing video sites almost unusable.

Firefox 127 and i have the same bug. the video stops and audio continues to play fine, after about 20-30s video will play again. does not happen with other browser. only active plugin is ublock origin.

Not sure if it's related, but after downgrading to 123.0b9, I noticed on the console that the following warnings are printed when I switch tabs or seek a video, which is a the same time as the stuttering and crashes would happen on later versions.

ATTENTION: default value of option mesa_glthread overridden by environment.
[GFX1-]: Couldn't sanitize GL_RENDERER "OLAND (, LLVM 15.0.7, DRM 2.50, 5.15.0-105-generic)"

I really hope that this bug is fixed soon, because it makes Firefox nearly unusable to watch videos online. I've downgraded for now, but I am also considering switching to Chromium if Firefox is still unusable in a few months.

Hello, gaudet,
Is this issue still happening on the lastest Nightly, or on a fresh profile of Firefox? In addition, I wonder if turning off the pref media.hardware-video-decoding.enabled would help on this issue? If not, could you turn it back and then capture a profiled result for us by following this instruction? Thank you so much!

Blocks: yt-playback
Flags: needinfo?(gaudet.eric)

Just to add, even with my downgraded Firefox v121, every few minutes, videos just stall with the loading symbol, until I refresh the page. Disabled my adblockers, just in case, to confirm they're not the problem. I've switched to using Brave for youtube entirely.

It would be easier for users for provide info, if there were a way + clear steps to install Firefox in a sandbox of sorts, without affecting/risking their existing profiles.

Still, since I no longer use Firefox for youtube, I've gone ahead to release my snap-hold and upgrade to latest/stable (130.0.1) on my Ubuntu 22.04:

(Disabling adblockers doesn't help.)

On this same version, I created a fresh profile, launched it in another window, and carried out the test:

  • NO: media.hardware-video-decoding.enabled = true (default): https://share.firefox.dev/4ddnwlL
  • NO: media.hardware-video-decoding.enabled = false: Didn't bother capturing the data.

Installing the nightly (131.0b7) was more straightforward than expected, so I did that and tested (with a fresh profile naturally):

  • NO: media.hardware-video-decoding.enabled = true (default): https://share.firefox.dev/3Xv60DR
  • NO: media.hardware-video-decoding.enabled = false: Didn't bother capturing the data.

YES = issue was reproduced (quite easily), NO = issue was not reproduced. Test video is the same one I sent earlier: https://www.youtube.com/watch?v=crtQSTYWtqE

(Of course, it's possible that even in the NO scenarios, the issue is still reproducible, just with other videos that I don't know of. I can only test with the single video I know about and hope that if the issue exists at all, it will manifest with this video, regardless of which Firefox version/profile I'm using.)

Let me know if you need any other data.

Flags: needinfo?(alwu)

Wow, bug 1922278 related to YouTube playback really got fixed quickly.

@Sotaro Ikeda (:sotaro) maybe you could take a look into this regression, too? 🙏 Still happening on FF 131.0.3 and really easy to reproduce.

I haven't been able to repro this on my side (Debian Bookworm). Since it seems like the behavior started at a specific version of Firefox and can be quickly repro'd for you, running a bisection could help to figure out the exact changes that caused this issue. Would you be able to try out mozregression? You can run mozregression -g <most recent firefox version that works for you> -b <most recent firefox version that *doesn't* work for you>. You can also just omit the -b parameter and it'll use the most recent release. Mozregression will start different versions of Firefox to narrow down the issue - see if you can repro the issue on each one, follow the prompts that ask Was this nightly build good, bad, or broken? (type 'good', 'bad', 'skip', 'retry' or 'exit' and press Enter):, and then please add the results to the bug report.

Flags: needinfo?(github)

Thanks for your reply, :az.

The prebuilt packages of mozregression don't work for me, but with pip install mozregression I got it to work, rustup default stable was needed as well.
I've tried mozregression to no avail, so I figured it must have something to do with my individual setup.

So today I've learned about the "Refresh Firefox" feature. Done that, and the problem seems to be gone. It must have been an about:config setting or an extension/plugin. I've only had a few extensions, none of them related to video as far as I know.

Now I can even watch Disney+ and www.zdf.de/live-tv again, which stopped working months ago. At that time I blamed the respective site for the malfunction and didn't investigate further.


TL;DR try "Refresh Firefox": https://support.mozilla.org/en-US/kb/refresh-firefox-reset-add-ons-and-settings#w_refresh-firefox

Flags: needinfo?(github)

That's great Joe, happy to hear it! It seems like something similar (creating a new profile) cleared up the problem for bcejike. bcejike, would you be able to post your about:support text both from a crashing profile and from a non-crashing profile so we could compare?

Flags: needinfo?(bcejike)

@az FYI, my earlier comment here has all kinds of data, tested with different profiles and nightlies: https://bugzilla.mozilla.org/show_bug.cgi?id=1885795#c25.

If that doesn't have what you need, then let me know.

Flags: needinfo?(bcejike) → needinfo?(azebrowski)

Hi bcejike, I did see the profiles (thanks!) but there's additional information in about:support (changed prefs, etc.) that's not included with the profiles. Even without the about:support info, I did notice that on the failing profile the following extensions are installed:

    Abstract – Bold
    Add-ons Search Detection
    Bing
    Bitwarden Password Manager
    DuckDuckGo
    DuckDuckGo Privacy Essentials
    Facebook Container
    Form Autofill
    GNOME Shell integration
    Google
    Picture-In-Picture
    Tampermonkey
    Web Compatibility Interventions
    Wikipedia (en)
    eBay
    uBlock Origin

On the profile which doesn't repro the issue, the majority of those extensions aren't installed:

    Add-ons Search Detection
    Form Autofill
    Picture-In-Picture
    System theme — auto
    Web Compatibility Interventions

Would you be able to disable the extensions on your failing profile by going to about:addons and check if that fixes the problem there? If this fixes the issue, would you be able to re-enable the extensions one-by-one to help pinpoint the problematic one? If disabling the extensions doesn't change anything, then having about:support information from both the failing and working profile would be useful to see if there are any differences there which could be causing the issue. Thanks!

Flags: needinfo?(azebrowski) → needinfo?(bcejike)

Okay, here I've used Troubleshoot Mode to disable all extensions at once (that's what it says on the tin anyways). I can still reproduce the issue in this mode.

Troubleshoot Mode (all extensions implicitly disabled): YES: about:support
Test profile (no extensions installed): NO: about:support

YES = issue was reproduced (easily), NO = issue was not reproduced, despite several attempts. Test video is the same one I sent earlier: https://www.youtube.com/watch?v=crtQSTYWtqE

Both tests were with the same Firefox version 130.0.1 to keep conditions as similar as possible.

Flags: needinfo?(bcejike)
Flags: needinfo?(azebrowski)
Flags: needinfo?(alwu)
Flags: needinfo?(alwu)

Redirect a needinfo that is pending on an inactive user to the triage owner.
:jimm, since the bug doesn't have a severity set, could you please set the severity or close the bug?

For more information, please visit BugBot documentation.

Flags: needinfo?(gaudet.eric) → needinfo?(jmathies)

Just wanted to re-ping :alwu in case he'd have some free cycles to give some input here, or if he'd know who best to redirect this to.

Severity: -- → S3
Flags: needinfo?(jmathies)
Flags: needinfo?(azebrowski)

Still happening with ff 138.0.4
I tried to remove all plugins and it's the same.

I notice that it's also happening in the following manner:

  • play a youtube video
  • open another tab and browse random pages in this new tab
  • hover the video tab
    -> the video crashes (not every time) just before displaying the page title under the tab.

I think the bug may be related to thread interactions between the DOM and the codec.

You need to log in before you can comment on or make changes to this bug.