Closed fulalas closed 1 year ago
Though not apples to apples, I'm using Firefox on Clear Linux and vp9 decoding works great. In the ffmpeg-on-clear-linux repository exists scripts for building nv-codec-headers
, libvdpau
, and vdpau-va-driver-v9
to include scripts for building ffmpeg-cuda
and dependencies.
I lack the time to try similarly for Chromium. Well, captured various output.
export LIBVA_DRIVERS_PATH=/usr/lib64/dri
export LIBVA_DRIVER_NAME=nvidia
$ ldd /usr/lib64/dri/nvidia_drv_video.so
...
libvdpau.so.1 => /usr/local/lib/libvdpau.so.1 (0x00007fba230cc000)
libGL.so.1 => /opt/nvidia/lib64/libGL.so.1 (0x00007fba23550000)
libGLX.so.0 => /opt/nvidia/lib64/libGLX.so.0 (0x00007fba22ca2000)
libGLdispatch.so.0 => /opt/nvidia/lib64/libGLdispatch.so.0 (0x00007fba229b1000)
...
$ vainfo
libva info: VA-API version 1.11.0
libva info: Trying to open /usr/lib64/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_11
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.11 (libva 2.11.0)
vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA-API - 0.7.4
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG4Simple : VAEntrypointVLD
VAProfileMPEG4AdvancedSimple : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
$ vdpauinfo
display: :0 screen: 0
API version: 1
Information string: NVIDIA VDPAU Driver Shared Library 495.29.05 Thu Sep 30 15:49:18 UTC 2021
Video surface:
name width height types
-------------------------------------------
420 8192 8192 NV12 YV12
422 8192 8192 UYVY YUYV
444 8192 8192
Decoder capabilities:
name level macbs width height
----------------------------------------------------
MPEG1 0 65536 4096 4096
MPEG2_SIMPLE 3 65536 4096 4096
MPEG2_MAIN 3 65536 4096 4096
H264_BASELINE 51 65536 4096 4096
H264_MAIN 51 65536 4096 4096
H264_HIGH 51 65536 4096 4096
VC1_SIMPLE 1 8190 2048 2048
VC1_MAIN 2 8190 2048 2048
VC1_ADVANCED 4 8190 2048 2048
MPEG4_PART2_SP 3 8192 2048 2048
MPEG4_PART2_ASP 5 8192 2048 2048
DIVX4_QMOBILE 0 8192 2048 2048
DIVX4_MOBILE 0 8192 2048 2048
DIVX4_HOME_THEATER 0 8192 2048 2048
DIVX4_HD_1080P 0 8192 2048 2048
DIVX5_QMOBILE 0 8192 2048 2048
DIVX5_MOBILE 0 8192 2048 2048
DIVX5_HOME_THEATER 0 8192 2048 2048
DIVX5_HD_1080P 0 8192 2048 2048
H264_CONSTRAINED_BASELINE 51 65536 4096 4096
H264_EXTENDED 51 65536 4096 4096
H264_PROGRESSIVE_HIGH 51 65536 4096 4096
H264_CONSTRAINED_HIGH 51 65536 4096 4096
H264_HIGH_444_PREDICTIVE 51 65536 4096 4096
HEVC_MAIN 153 262144 8192 8192
HEVC_MAIN_10 153 262144 8192 8192
HEVC_MAIN_STILL --- not supported ---
HEVC_MAIN_12 153 262144 8192 8192
HEVC_MAIN_444 153 262144 8192 8192
...
I am delighted to report that vp9 decoding is working in Chromium. The chromium-latest-linux repository works great on Clear Linux. I modified the run.sh
script as such.
#! /bin/bash
export LIBVA_DRIVERS_PATH=/usr/lib64/dri
export LIBVA_DRIVER_NAME=nvidia
export LD_LIBRARY_PATH=/opt/nvidia/lib64:/usr/local/lib
export FONTCONFIG_PATH=/usr/share/defaults/fonts
# To rid of the Google API keys are missing notification.
export GOOGLE_API_KEY=no
export GOOGLE_DEFAULT_CLIENT_ID=no
export GOOGLE_DEFAULT_CLIENT_SECRET=no
BASEDIR=$(dirname $0)
if [ $XDG_SESSION_TYPE == wayland ]
then
$BASEDIR/latest/chrome --window-size=1100,900 \
--use-gl=egl --enable-features=VaapiVideoDecoder \
--user-data-dir="$DATADIR" $* &> /dev/null &
elif [ $XDG_SESSION_TYPE == x11 ]
then
$BASEDIR/latest/chrome --window-size=1100,900 \
--use-gl=desktop --enable-features=VaapiVideoDecoder \
--user-data-dir="$DATADIR" $* &> /dev/null &
fi
First time
$ ./update-and-run.sh
Subsequently
$ ./run.sh
--disable-features=UseChromeOSDirectVideoDecoder
I'm failing to hardware decode YouTube vp9 videos -- I'm using this for testing: https://www.youtube.com/watch?v=ojNFvNcMPsE
My system: Slackware x64 current Xorg 1.20.13 (12013000) Nvidia GTX 1650 Super proprietary driver 460.91.03
Using Chromium 88.0.4324.96
This command uses FfmpegVideodecoder (hwdec fails):
# chromium --enable-features=VaapiVideoDecoder
This command uses MojoVideoDecoder (hwdec works, but only for avc1)
# chromium use-gl=desktop --enable-features=VaapiVideoDecoder
Using Opera 82.0.4227.23 (Chrome/96.0.4664.45) using lib_extra/libffmpeg.so
This command uses VDAVideoDecoder (hwdec works, but only for avc1)
# opera --use-gl=desktop --enable-features=VaapiVideoDecoder
This command uses VDAVideoDecoder (hwdec doesn't work)
# opera --enable-features=VaapiVideoDecoder
Some tests result that may help investigating the issue
# vainfo
Weirdly, without your vp9 plugin I get this:
# vainfo
vaInitialize failed with error code -1 (unknown libva error),exit
When running a VP9 video on Mpv using hwdec=vaapi-copy:
When running a VP9 video on Mpv using hwdec=auto (hwdec works -- it selects nvdec-copy):
no error/warning
When running a VP9 video on Mpv using hwdec=vdpau-copy (hwdec works):
no error/warning
Questions:
Thanks in advance!