Closed Bug 1750760 Opened 2 years ago Closed 2 years ago

Implement support for ffmpeg 5.0

Categories

(Core :: Audio/Video: Playback, task, P3)

Firefox 91
task

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: mss, Assigned: stransky)

References

Details

Attachments

(4 files)

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

Steps to reproduce:

Having updated to ffmpeg version 5.0, I am now unable to play videos on Twitter on Firefox 91.5.0esr (latest). VP8 WEBM's and YouTube videos work, but not Twitter videos.

I did rebuild Firefox 91.5.0esr after updating ffmpeg to 5.0, and the way I built Firefox and ffmpeg are 1:1 the same therefore I believe the ffmpeg version changing is the issue.

This occurred on an x86_64 musl linux build, both the browser is built using a complete LLVM toolchain w/o anything GCC/Binutils in it.

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

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

Problem also occurs with MP4 videos, the same video can be played via mpv which relies on ffmpeg, here's the info on the video:

  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2
    creation_time   : 2022-01-17T14:31:22.000000Z
  Duration: 01:16:54.21, start: 0.000000, bitrate: 628 kb/s
  Stream #0:0[0x2](eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive),
1920x1080, 563 kb/s, 15 fps, 15 tbr, 10k tbn (default)
    Metadata:
      creation_time   : 2022-01-17T14:31:22.000000Z
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x1](eng): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 61 kb/s (default)
    Metadata:
      creation_time   : 2022-01-17T14:31:22.000000Z
      vendor_id       : [0][0][0][0]
See Also: → 1750829

Can confirm downgraded to ffmpeg 4.4.1 and i was able to watch videos again

Ffmpeg 5 broke Firefox playing video

in classic mozilla fashion i assume you are waiting some maintainer from a big distro to report the same bug in a few weeks from now on to actually confirm the bug?

(In reply to mss from comment #5)

in classic mozilla fashion i assume you are waiting some maintainer from a big distro to report the same bug in a few weeks from now on to actually confirm the bug?

Nope just letting other people know my findings - downgrading ffmpeg fixed the bug.

Its up to the firefox devs to do make due with the information given.

(In reply to mss from comment #5)

in classic mozilla fashion i assume you are waiting some maintainer from a big distro to report the same bug in a few weeks from now on to actually confirm the bug?

I just care that I got it working again

It looks like something similar happened (bug 1435212). Maybe it can be fixed with the same approach?

I can look at it.

(In reply to mss from comment #5)

in classic mozilla fashion i assume you are waiting some maintainer from a big distro to report the same bug in a few weeks from now on to actually confirm the bug?

The Bug status is irrelevant. Unless it's taken someone to do the work it doesn't matter if the bug is unconfirmed/new/assigned etc.

Summary: ``you may need to install video codecs'' warning with ffmpeg 5.0 → Implement support for ffmpeg 5.0
Severity: -- → N/A
Type: defect → task
Priority: -- → P3

Let's wait until ffmpeg 5.0 hits rpmfusion.org for Fedora 36 so I can install it from it. I'm not going to build my own package for that.

(In reply to Martin Stránský [:stransky] (ni? me) from comment #11)

Let's wait until ffmpeg 5.0 hits rpmfusion.org for Fedora 36 so I can install it from it.

there exists this and it features rpm's built from the same commit that updated the rpmfusion's spec file to 5.0 stable:

Maybe this error messages helps:

[Child 1588, MediaDecoderStateMachine #1] WARNING: Decoder=7d11d7d0ec00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file /src/firefox-97.0b9/dom/media/MediaDecoderStateMachine.cpp:3568

[Child 413, MediaDecoderStateMachine #2] WARNING: Decoder=7678947f7c00 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mpeg: file /src/firefox-97.0b9/dom/media/MediaDecoderStateMachine.cpp:3568


mp4a-latm seems to be removed from ffmpeg:
https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/e8876bdcf3b4a8e5320884ffb9d39ce30e23f0e6

parts of audio/mpeg seemed to be removed to from ffmpeg to:
https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/2e2891383e596314a9888ba9b99d6987c82d7c9b

so some videos play, others with the mentioned codecs gives error message and video don't play. I don't know if this was all of the removed parts
but these are the two codecparts which firefox complains in my case.

I get into the same issue:
I partially updated my Arch Linux system, everything except for Firefox, which, starting with this version (97.0.1-1), requires the legacy ffmpeg4.4 in place of ffmpeg which has been promoted to latest version (v5.0) in the meantime.

NB: I haven't forced this partial upgrade, I have just skipped the Firefox one; this means no conflicts were recognized by Pacman (Arch's package manager), so nothing esoteric has happened.

This operation get me to an issue: now Firefox shows me the message "To play video, you may need to install the required video codecs."
At the begin, I ignored the message because the page I was viewing let me see the video[1].
After some day, I discovered some video playback[2] or preview didn't work[3], with or without that message.

And now I am here, to report this issue.

PS: just install ffmpeg4.4, close and reopen the tab e.g.[2], to 'fix' the issue;
here is the list of sonames provided by ffmpeg v4.4[4] and v5.0[5].


1: [https://www.finanzaonline.com/forum/etf-fondi-e-gestioni-e-investment-certificates/1971305-euclidea-e-nata-una-nuova-sim-vol-2-a-66.html]
2: [https://twitter.com/kdrag0n/status/1493088558676017152]
3: [https://www.google.com/search?q=google+video&client=firefox-b-d&source=lnms&tbm=vid&sa=X&ved=2ahUKEwiv8s259432AhVXSvEDHUqOCrcQ_AUoAXoECAIQAw&biw=1184&bih=589&dpr=1.62]
4: [https://archlinux.org/packages/extra/x86_64/ffmpeg4.4/]
5: [https://archlinux.org/packages/extra/x86_64/ffmpeg/]

Assignee: nobody → stransky

We need to create a new module ffmpeg 59 for that.

FFmpegVideoFramePool is used by ffvpx, ffmpeg58 and ffmpeg59 modules. Let's move it to ffvpx as it's always present.

Depends on D139696

FFmpeg 5.0 removed some deprecated symbols so we need to update our decoding code for it.

Depends on D139698

See Also: 1750829

Patches work for me. I can now watch all video. Thank you.

Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/06b1ee71577a
Create ffmpeg59 module for ffmpeg5.0 r=alwu
https://hg.mozilla.org/integration/autoland/rev/bc5fea217ad0
Build FFmpegVideoFramePool in ffvpx module r=alwu
https://hg.mozilla.org/integration/autoland/rev/6ea8585e5d21
Open libavcodec.so.59 library and bind ffmpeg 5.0 symbols r=alwu
https://hg.mozilla.org/integration/autoland/rev/dced8add243a
Update audio and video decoders to ffmpeg 5.0 r=alwu
Attachment #9265479 - Attachment description: Bug 1750760 Build FFmpegVideoFramePool in ffvpx module r?alwu → Bug 1750760 Build FFmpegVideoFramePool in ffvpx module r=alwu
Attachment #9265478 - Attachment description: Bug 1750760 Create ffmpeg59 module for ffmpeg5.0 r?alwu → Bug 1750760 Create ffmpeg59 module for ffmpeg5.0 r=alwu

Martin, I took the liberty of fixing up the lint for you since otherwise I can't watch videos in Nightly anymore, hopefully that's fine with you. It was basically this interdiff which should be unobjectionable, but please take a look just in case: https://phabricator.services.mozilla.com/D139696?vs=551603&id=551730#toc

Marian-Vasile, do you know why Martin wasn't ni?d in the bug after the backout? Otherwise he might've missed that the failures needed addressing. Thanks for keeping the tree green though :)

Flags: needinfo?(stransky)
Flags: needinfo?(mlaza)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c403bda32e9d
Create ffmpeg59 module for ffmpeg5.0 r=alwu
https://hg.mozilla.org/integration/autoland/rev/def47ebb3e7c
Build FFmpegVideoFramePool in ffvpx module r=alwu
https://hg.mozilla.org/integration/autoland/rev/22abbc3706dd
Open libavcodec.so.59 library and bind ffmpeg 5.0 symbols r=alwu
https://hg.mozilla.org/integration/autoland/rev/0c6b7084cdb5
Update audio and video decoders to ffmpeg 5.0 r=alwu

(In reply to Emilio Cobos Álvarez (:emilio) from comment #23)

Marian-Vasile, do you know why Martin wasn't ni?d in the bug after the backout? Otherwise he might've missed that the failures needed addressing. Thanks for keeping the tree green though :)

Sorry for this, it was a mishap from my part when I posted the backout info... I'll be more careful next time :)

Flags: needinfo?(mlaza)
Regressions: 1758610
Depends on: 1759137
Regressions: 1759137

(In reply to Emilio Cobos Álvarez (:emilio) from comment #23)

Martin, I took the liberty of fixing up the lint for you since otherwise I can't watch videos in Nightly anymore, hopefully that's fine with you. It was basically this interdiff which should be unobjectionable, but please take a look just in case: https://phabricator.services.mozilla.com/D139696?vs=551603&id=551730#toc

Sure, Thanks.

Marian-Vasile, do you know why Martin wasn't ni?d in the bug after the backout? Otherwise he might've missed that the failures needed addressing. Thanks for keeping the tree green though :)

I was aware of that but I was already on PTO.

Flags: needinfo?(stransky)
No longer depends on: 1759137
No longer regressions: 1759596
Regressions: 1759596
Regressions: 1762725
No longer regressions: 1759596
Regressions: 1764436
No longer regressions: 1764436
Regressions: 1764436
No longer regressions: 1762725
Regressions: 1759596
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: