Closed Bug 1933452 Opened 15 days ago Closed 7 days ago

Video freeze after a few seconds, but audio continues. After some time the video resumes

Categories

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

defect

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: julienw, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

STR:

  1. Open https://www.youtube.com/watch?v=QKu5p658bOk
  2. Play the video.
  3. After a few seconds (sometimes 16, sometimes 19) the video freezes, but the sound continues.
  4. After more seconds the video seems to resume.

profile from about:logging => https://share.firefox.dev/3V8SRQg

When skipping the video manually we can make the video resume just after the freeze.

Attached file about-support.json

Alastor, really strange profile, can you give it a go with your tool so we understand what's going on? I see two frames of av1 taking about 6s (instead of about 80us) to decode in the RDD when this happens.

Flags: needinfo?(alwu)

https://share.firefox.dev/4eL6uMx <= this one should be at 720p all the time, less distractions.

This issue is probably Linux only, and the reason of video freezing was because we skipped 6 seconds of video frames from here. The detailed investigation is below.


Now the question,
Q: Why did we get that decode error when sending the first frame? Was the decoder not configured properly or something else?
A: I'm suspecting that it's related with VAPPI, per this we can see all previous images were sw based images, maybe we incorrectly tried to create a hw decoder and failed. From the logging, we can even found Video decode error, disable HW acceleration from here.

Flags: needinfo?(alwu)

Could you try to disable the pref media.hardware-video-decoding.enabled to see if it helps? Thanks!

Flags: needinfo?(felash)

Yeah exactly, when I disable it and restart Firefox, then the video doesn't freeze anymore.

Flags: needinfo?(felash)

Julien, could you help me enable the pref and capture a profile again by using about:logging with the media playback preset and adding an additional log module ,FFmpegVideo:5? Thanks!

Flags: needinfo?(felash)
Flags: needinfo?(felash)

Julien, could you help me try if this build works for you? Also could you help me capture a profile again by following the instruction in the comment7, so that I can verify whether the issue is solved properly by checking the logs. Thanks!

Flags: needinfo?(felash)
Blocks: yt-playback
Priority: -- → P2

Hey Alastor !
Yes this seems to work for me :)
Here is the requested profile => https://share.firefox.dev/4gbQi8j

Flags: needinfo?(felash)
Severity: -- → S3

When a video error occurs, we have a mechanism in place to skip to the
next frame if next keyframe exists [1]. However, if the error is caused
by the inability to use HW decoding when recreating a decoder, this
mechanism should not be triggered.

By setting 'mFirstFrameTime' in this case, we ensure that we can fall
back to the SW decoder with the correct sample time, preventing the
skipping of frames.

[1] https://searchfox.org/mozilla-central/rev/48556b26b96a32672caa46b9abb6d56c234cd84f/dom/media/MediaFormatReader.cpp#2594-2599

Assignee: nobody → alwu
Status: NEW → ASSIGNED
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/834790678f44 set 'mFirstFrameTime' to prevent skipping video frames in the case of newly created HW decoder fails on decoding the first frame. r=media-playback-reviewers,karlt
Status: ASSIGNED → RESOLVED
Closed: 7 days ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: