clearfraction / distribution

Project info & bugreports collector
31 stars 1 forks source link

H264 playback on Firefox doesn't work after codecs bundle install and reboot #28

Closed worldofgeese closed 1 year ago

worldofgeese commented 1 year ago
cat /etc/profile.d/10-cf.sh
[[ ! ${PATH} =~ "/opt/3rd-party/bundles/clearfraction/bin" ]] && \
  PATH=$PATH:/opt/3rd-party/bundles/clearfraction/bin:/opt/3rd-party/bundles/clearfraction/usr/bin:/opt/3rd-party/bundles/clearfraction/usr/local/bin

[[ ! ${LD_LIBRARY_PATH} =~ "/opt/3rd-party/bundles/clearfraction/usr/lib64" ]] && \
  LD_LIBRARY_PATH=/usr/lib64:/opt/3rd-party/bundles/clearfraction/usr/lib64:/opt/3rd-party/bundles/clearfraction/usr/local/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

[[ ! ${XDG_DATA_DIRS} =~ "/opt/3rd-party/bundles/clearfraction/usr/share" ]] && \
  XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}:/opt/3rd-party/bundles/clearfraction/usr/share/:/opt/3rd-party/bundles/clearfraction/usr/local/share/

[[ ! ${XDG_CONFIG_DIRS} =~ "/opt/3rd-party/bundles/clearfraction/usr/share/xdg" ]] && \
  XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS:-/usr/share/xdg:/etc/xdg}:/opt/3rd-party/bundles/clearfraction/usr/share/xdg:/opt/3rd-party/bundles/clearfraction/etc/xdg

[[ ! ${FONTCONFIG_PATH} =~ "/usr/share/defaults/fonts" ]] && \
  FONTCONFIG_PATH=/usr/share/defaults/fonts${FONTCONFIG_PATH:+:$FONTCONFIG_PATH}

[[ ! ${GST_PLUGIN_PATH_1_0} =~ "/opt/3rd-party/bundles/clearfraction/usr/lib64/gstreamer-1.0" ]] && \
  GST_PLUGIN_PATH_1_0=${GST_PLUGIN_PATH_1_0:-/usr/lib64/gstreamer-1.0}:/opt/3rd-party/bundles/clearfraction/usr/lib64/gstreamer-1.0
cat /etc/environment.d/10-cf.conf
PATH=$PATH:/opt/3rd-party/bundles/clearfraction/bin:/opt/3rd-party/bundles/clearfraction/usr/bin:/opt/3rd-party/bundles/clearfraction/usr/local/bin
LD_LIBRARY_PATH=/usr/lib64:/opt/3rd-party/bundles/clearfraction/usr/lib64:/opt/3rd-party/bundles/clearfraction/usr/local/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}:/opt/3rd-party/bundles/clearfraction/usr/share/:/opt/3rd-party/bundles/clearfraction/usr/local/share/
XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS:-/usr/share/xdg:/etc/xdg}:/opt/3rd-party/bundles/clearfraction/usr/share/xdg:/opt/3rd-party/bundles/clearfraction/etc/xdg
FONTCONFIG_PATH=/usr/share/defaults/fonts${FONTCONFIG_PATH:+:$FONTCONFIG_PATH}
GST_PLUGIN_PATH_1_0=${GST_PLUGIN_PATH_1_0:-/usr/lib64/gstreamer-1.0}:/opt/3rd-party/bundles/clearfraction/usr/lib64/gstreamer-1.0

Steps I've taken:

sudo swupd 3rd-party add clearfraction https://download.clearfraction.cf/update
sudo swupd 3rd-party bundle-add codecs
echo "export LD_LIBRARY_PATH=/opt/3rd-party/bundles/clearfraction/usr/lib64" >> "${HOME}/.config/firefox.conf"

I've rebooted my machine twice and done a full profile wipe then repeated the steps above.

11th Gen Intel® Core™ i5-1135G7, GNOME on X11

marioroy commented 1 year ago

@worldofgeese. Some time ago, I had success with video HW acceleration on an Intel NUC. The codecs bundle will not do it alone. You need the Firefox config and some settings via about:config.

See the HWAccel folder. Optionally, adjust the AV1 setting matching your Intel graphics AV1 capability { false or true }.

  1. Install codecs bundles from 3rd-party which you have
  2. Copy the firefox/firefox.conf to ~/.config/
  3. Apply the following Firefox settings via about:config a. media.ffmpeg.vaapi.enabled true b. media.ffvpx.enabled false c. media.av1.enabled false
marioroy commented 1 year ago

There's another about:config setting for NVIDIA graphics (codecs-cuda). Basically, all the settings mentioned above including this one.

Required, for HW acceleration to work using NVIDIA driver 470 (or newer series).
widget.dmabuf.force-enabled                    true
worldofgeese commented 1 year ago

My experience is this still isn't working

I've applied @marioroy's changes by copying firefox/firefox.conf to $HOME/.config/firefox/firefox.conf.

The following flags are set to true:

a. media.ffmpeg.vaapi.enabled true b. media.ffvpx.enabled false c. media.av1.enabled false

I'm testing with the enhanced-h264ify extension set to h264-only and receive this error on YouTube

image

The Fedora team has put out these tips which I've confirmed are all set appropriately

image

image

Output of vainfo

Trying display: wayland
libva info: VA-API version 1.18.0
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.18 (libva 2.18.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.1.5 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI
      VAProfileHEVCMain               : VAEntrypointEncSliceLP
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointEncSliceLP
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile1            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileVP9Profile3            : VAEntrypointVLD
      VAProfileHEVCMain12             : VAEntrypointVLD
      VAProfileHEVCMain12             : VAEntrypointEncSlice
      VAProfileHEVCMain422_10         : VAEntrypointVLD
      VAProfileHEVCMain422_10         : VAEntrypointEncSlice
      VAProfileHEVCMain422_12         : VAEntrypointVLD
      VAProfileHEVCMain422_12         : VAEntrypointEncSlice
      VAProfileHEVCMain444            : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10         : VAEntrypointVLD
      VAProfileHEVCMain444_10         : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_12         : VAEntrypointVLD
      VAProfileHEVCSccMain            : VAEntrypointVLD
      VAProfileHEVCSccMain            : VAEntrypointEncSliceLP
      VAProfileHEVCSccMain10          : VAEntrypointVLD
      VAProfileHEVCSccMain10          : VAEntrypointEncSliceLP
      VAProfileHEVCSccMain444         : VAEntrypointVLD
      VAProfileHEVCSccMain444         : VAEntrypointEncSliceLP
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileHEVCSccMain444_10      : VAEntrypointVLD
      VAProfileHEVCSccMain444_10      : VAEntrypointEncSliceLP
paulcarroty commented 1 year ago
  1. Does ffplay https://www.w3schools.com/html/mov_bbb.mp4 works in terminal?
  2. Open this link in Firefox without any extensions and test the video again.
worldofgeese commented 1 year ago

@paulcarroty both of those worked!

paulcarroty commented 1 year ago

So the x264 decoding actually works, guess the problem happened with h264ify extension.

x-sublime commented 1 year ago

If I try to open mp4 , streaming or from my disk, firefox give me this error:

firefox [Child 112732, MediaDecoderStateMachine #1] WARNING: Decoder=558b1082a400 Decode error: NS_ERROR_DOM_MEDIA_DECODE_ERR (0x806e0004) - virtual mozilla::MediaResult mozilla::FFmpegVideoDecoder<58>::DoDecode(mozilla::MediaRawData , uint8_t , int, bool *, MediaDataDecoder::DecodedData &): avcodec_send_packet error: Invalid argument: file /builds/worker/checkouts/gecko/dom/media/MediaDecoderStateMachineBase.cpp:164 [Child 112732, MediaDecoderStateMachine #1] WARNING: Decoder=558b1082a400 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file /builds/worker/checkouts/gecko/dom/media/MediaDecoderStateMachineBase.cpp:164

ffplay or mpv work fine with the same link or file from disk This happens after update 3rd-Party Repository: clearfraction to vs. 38680 and I have not h264ify extension. The problem seems: "Error no decoder found for audio/mp4a-latm" (ffmpeg)

sudo swupd 3rd-party bundle-list Password:


3rd-Party Repository: clearfraction


Installed bundles:

Total: 3

paulcarroty commented 1 year ago

Hmm, it's getting more interesting. Can you test the codecs bundle too?

Maybe Update to 111.0.1 did it or ffmpeg-cuda v6 bump.

x-sublime commented 1 year ago

With codecs bundle trying to open the link https://www.w3schools.com/html/mov_bbb.mp4 I get the same error:

firefox [Child 17050, MediaDecoderStateMachine #1] WARNING: Decoder=55e1d5058500 Decode error: NS_ERROR_DOM_MEDIA_DECODE_ERR (0x806e0004) - virtual mozilla::MediaResult mozilla::FFmpegVideoDecoder<58>::DoDecode(mozilla::MediaRawData , uint8_t , int, bool *, MediaDataDecoder::DecodedData &): avcodec_send_packet error: Invalid argument: file /builds/worker/checkouts/gecko/dom/media/MediaDecoderStateMachineBase.cpp:164 [Child 17050, MediaDecoderStateMachine #1] WARNING: Decoder=55e1d5058500 Decode error: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm: file /builds/worker/checkouts/gecko/dom/media/MediaDecoderStateMachineBase.cpp:164

x-sublime commented 1 year ago

I had firefox 111.0.1 with v.38320 and all worked... probably ffmpeg v6 problem.

paulcarroty commented 1 year ago

https://bugzilla.mozilla.org/show_bug.cgi?id=1819374, fixed in Firefox 112.

Workarounds: update to Firefox Beta or use mpv + yt-dlp for HTML5 video.

paulcarroty commented 1 year ago

Fixed in CL 38750.