Closed Bug 1745225 Opened 1 year ago Closed 1 year ago

[Linux] Provide AV1 VA-API playback

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
98 Branch

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Provide AV1 AV-API playback on Linux.

Depends on: 1652958
Depends on: 1745226
Depends on: 1745228
Depends on: 1745284
Depends on: 1745285

VA-API? Or is it something different?

Summary: [Linux] Provide AV1 AV-API playback → [Linux] Provide AV1 VA-API playback
Depends on: 1749959

Should be working now.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Regressions: 1749324

Because some fixes landed in 98 I'll mark this for Firefox 98: https://bugzilla.mozilla.org/show_bug.cgi?id=1745285#c22

Target Milestone: --- → 98 Branch

Are there any explicit config settings that are needed to enable av1 vaapi decoding?

Trying it in KDE Plasma 5.26.0 Wayland session with Firefox 107.0b2, I don't see it triggering VAAPI neither in monitoring AMD VCN usage, nor in the logs with MOZ_LOG="PlatformDecoderModule:5". Am I missing something?

My ffmpeg is recent enough (5.1.2, from Debian testing).

I was testing a video from here: https://bitmovin.com/demos/av1

This is currently set:

media.ffmpeg.vaapi.enabled = true

Hardware: AMD RX 6800 XT.

vainfo shows av1 support.

libva info: VA-API version 1.16.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_15
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.16 (libva 2.12.0)
vainfo: Driver version: Mesa Gallium driver 22.2.0 for AMD Radeon RX 6800 XT (navi21, LLVM 14.0.6, DRM 3.47, 5.19.12)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

ffmpeg support for av1/vaapi:

ffmpeg -h decoder=av1
ffmpeg version 5.1.2-1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-3)
  configuration: --prefix=/usr --extra-version=1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Decoder av1 [Alliance for Open Media AV1]:
    General capabilities: dr1 avoidprobe 
    Threading capabilities: none
    Supported hardware devices: cuda vaapi vdpau 
AV1 decoder AVOptions:
  -operating_point   <int>        .D.V....... Select an operating point of the scalable bitstream (from 0 to 31) (default 0)

(In reply to Shmerl from comment #5)

Are there any explicit config settings that are needed to enable av1 vaapi decoding?

AV1 VA-API decoding uses Firefox internal (bundled) ffmpeg and should work out-of-the box if AV1 VA-API is supported.
If you don see it please attach MOZ_LOG="PlatformDecoderModule:5" log here.
Thanks.

Flags: needinfo?(shtetldik)

I think I see the issue in the log with MOZ_LOG="PlatformDecoderModule:5". Looks like it tries to initialize VAAPI and fails:

libva info: VA-API version 1.16.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
[Utility 558381: MediaSupervisor #1]: D/PlatformDecoderModule FFmpeg decoder rejects requested type 'audio/opus'
[Utility 558381: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder supports requested type 'audio/opus'
[Utility 558381: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder supports requested type 'audio/opus'
[Child 558281: MediaPDecoder #1]: V/PlatformDecoderModule AudioTrimmer[7fbfb878ef60] ::PrepareTrimmers: sample[0,21000] no trimming information
[Utility 558381: MediaPDecoder #1]: V/PlatformDecoderModule ProcessDecode: mDuration=21000µs ; mTime=0µs ; mTimecode=0µs
[Utility 558381: MediaPDecoder #1]: D/PlatformDecoderModule OpusDataDecoder[7fda8eb9bac0] ::Decode: Opus decoder skipping 312 of 960 frames
[Child 558281: MediaPDecoder #1]: V/PlatformDecoderModule AudioTrimmer[7fbfb878ef60] ::HandleDecodedResult: sample[0,21000] (decoded[0,13500] no trimming needed
libva info: Found init function __vaDriverInit_1_16
libva info: va_openDriver() returns 0
[AVHWDeviceContext @ 0x7f41ee36d840] Format 0x3231564e -> nv12.
[AVHWDeviceContext @ 0x7f41ee36d840] Format 0x30313050 -> p010le.
[AVHWDeviceContext @ 0x7f41ee36d840] Format 0x36313050 -> unknown.
[AVHWDeviceContext @ 0x7f41ee36d840] Format 0x30323449 -> yuv420p.
[AVHWDeviceContext @ 0x7f41ee36d840] Format 0x32315659 -> yuv420p.
[AVHWDeviceContext @ 0x7f41ee36d840] Format 0x56595559 -> unknown.
[AVHWDeviceContext @ 0x7f41ee36d840] Format 0x32595559 -> yuyv422.
[AVHWDeviceContext @ 0x7f41ee36d840] Format 0x59565955 -> uyvy422.
[AVHWDeviceContext @ 0x7f41ee36d840] Format 0x41524742 -> bgra.
[AVHWDeviceContext @ 0x7f41ee36d840] Format 0x41424752 -> rgba.
[AVHWDeviceContext @ 0x7f41ee36d840] Format 0x58524742 -> bgr0.
[AVHWDeviceContext @ 0x7f41ee36d840] Format 0x58424752 -> rgb0.
[AVHWDeviceContext @ 0x7f41ee36d840] VAAPI driver: Mesa Gallium driver 22.2.1 for AMD Radeon RX 6800 XT (navi21, LLVM 15.0.2, DRM 3.48, 6.0.2+).
[AVHWDeviceContext @ 0x7f41ee36d840] Driver not found in known nonstandard list, using standard behaviour.
[av1 @ 0x7f41fae2d800] Error parsing decoder bitstream filters 'av1_frame_split': Bitstream filter not found
[RDD 558370: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX: Couldn't initialise VA-API decoder
[RDD 558370: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX: Initialising FFmpeg decoder
[RDD 558370: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX: codec libdav1d : dav1d AV1 decoder by VideoLAN
[RDD 558370: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX: Set get_buffer2 for customized buffer allocation
[libdav1d @ 0x7f41fae27000] libdav1d cd5e415270285a58f48c1e9ec1a2dd024b9acf9f

Flags: needinfo?(shtetldik)

Same error occurs with this video: https://www.youtube.com/watch?v=hSTp4iX5GsI

When setting always prefer AV1 in https://youtube.com/testtube

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