Log in

View Full Version : MPV, Feodra and Hardware Decoding on Laptop


FranceBB
28th September 2020, 19:16
Hi there,
even though I've been a desktop only user for... well... years, namely from 1998 'till 2015, it comes a time in which everyone, sooner or later, has to buy a laptop. My turn was in 2016 when I had to be able to travel while carrying my data with me.
The laptop I went for in January 2016 was an Asus N552VX, namely:

- Intel i7 6700HQ 4c/8th 2.60GHz (3.20GHz) with AVX2
- 32GB of RAM (16x2) DDR4 from HyperX
- A built in Intel® HD Graphics 530
- A dedicated NVIDIA GTX 950M 4GB GDDR5
- 1 TB Intel SSD m2 (mSata)
- 1 TB Samsung EVO SSD Sata III
- 1 TB Samsung EVO SSD Sata III
- Crappy FULL HD 300 nits display

Leaving aside the terrible effort I had to make to get it to boot in Linux at the very beginning due to the severely bugged NVIDIA drivers and all the mess about Wayland and reverting to xorg countless times, I'm now stable on x11 Fedora 32.
The problem is, though, that I can't seem to get hardware decoding to work properly on MPV.

Vainfo returns the following:


[FranceBB@router-localhost ~]$ vainfo
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.7.0.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 2.4.1
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileH264ConstrainedBaseline: VAEntrypointFEI
VAProfileH264ConstrainedBaseline: VAEntrypointStats
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264Main : VAEntrypointFEI
VAProfileH264Main : VAEntrypointStats
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointFEI
VAProfileH264High : VAEntrypointStats
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileVP9Profile0 : VAEntrypointVLD



Vdpau returns this:


[FranceBB@router-localhost ~]$ vdpauinfo
display: :1 screen: 0
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
API version: 1
Information string: OpenGL/VAAPI backend for VDPAU

Video surface:

name width height types
-------------------------------------------
420 4096 4096 NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24
422 4096 4096 NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24
444 4096 4096 NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24

Decoder capabilities:

name level macbs width height
----------------------------------------------------
MPEG1 --- not supported ---
MPEG2_SIMPLE --- not supported ---
MPEG2_MAIN --- not supported ---
H264_BASELINE 51 16384 2048 2048
H264_MAIN 51 16384 2048 2048
H264_HIGH 51 16384 2048 2048
VC1_SIMPLE --- not supported ---
VC1_MAIN --- not supported ---
VC1_ADVANCED --- not supported ---
MPEG4_PART2_SP --- not supported ---
MPEG4_PART2_ASP --- not supported ---
DIVX4_QMOBILE --- not supported ---
DIVX4_MOBILE --- not supported ---
DIVX4_HOME_THEATER --- not supported ---
DIVX4_HD_1080P --- not supported ---
DIVX5_QMOBILE --- not supported ---
DIVX5_MOBILE --- not supported ---
DIVX5_HOME_THEATER --- not supported ---
DIVX5_HD_1080P --- not supported ---
H264_CONSTRAINED_BASELINE 51 16384 2048 2048
H264_EXTENDED --- not supported ---
H264_PROGRESSIVE_HIGH --- not supported ---
H264_CONSTRAINED_HIGH --- not supported ---
H264_HIGH_444_PREDICTIVE --- not supported ---
VP9_PROFILE_0 --- not supported ---
VP9_PROFILE_1 --- not supported ---
VP9_PROFILE_2 --- not supported ---
VP9_PROFILE_3 --- not supported ---
HEVC_MAIN --- not supported ---
HEVC_MAIN_10 --- not supported ---
HEVC_MAIN_STILL --- not supported ---
HEVC_MAIN_12 --- not supported ---
HEVC_MAIN_444 --- not supported ---

Output surface:

name width height nat types
----------------------------------------------------
B8G8R8A8 16384 16384 y
R8G8B8A8 16384 16384 y
R10G10B10A2 16384 16384 y
B10G10R10A2 16384 16384 y
A8 16384 16384 y

Bitmap surface:

name width height
------------------------------
B8G8R8A8 16384 16384
R8G8B8A8 16384 16384
R10G10B10A2 16384 16384
B10G10R10A2 16384 16384
A8 16384 16384

Video mixer:

feature name sup
------------------------------------
DEINTERLACE_TEMPORAL -
DEINTERLACE_TEMPORAL_SPATIAL -
INVERSE_TELECINE -
NOISE_REDUCTION -
SHARPNESS -
LUMA_KEY -
HIGH QUALITY SCALING - L1 -
HIGH QUALITY SCALING - L2 -
HIGH QUALITY SCALING - L3 -
HIGH QUALITY SCALING - L4 -
HIGH QUALITY SCALING - L5 -
HIGH QUALITY SCALING - L6 -
HIGH QUALITY SCALING - L7 -
HIGH QUALITY SCALING - L8 -
HIGH QUALITY SCALING - L9 -

parameter name sup min max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH -
VIDEO_SURFACE_HEIGHT -
CHROMA_TYPE -
LAYERS -

attribute name sup min max
-----------------------------------------------------
BACKGROUND_COLOR -
CSC_MATRIX -
NOISE_REDUCTION_LEVEL -
SHARPNESS_LEVEL -
LUMA_KEY_MIN_LUMA -
LUMA_KEY_MAX_LUMA -

FranceBB
28th September 2020, 19:17
If I try to use hardware acceleration on an old MPEG-2 DVD file, it works by using the internal Intel HD Graphics 530:


mpv -hwdec=vaapi -hwdec-codecs=all -v "/home/FranceBB/Share Windows Linux/Production/RAW/417-423/417.VOB"

[cplayer] Command line options: '-hwdec=vaapi' '-hwdec-codecs=all' '-v' '/home/FranceBB/Share Windows Linux/Production/RAW/417-423/417.VOB'
[cplayer] mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
[cplayer] built on UNKNOWN
[cplayer] ffmpeg library versions:
[cplayer] libavutil 56.31.100
[cplayer] libavcodec 58.54.100
[cplayer] libavformat 58.29.100
[cplayer] libswscale 5.5.100
[cplayer] libavfilter 7.57.100
[cplayer] libswresample 3.5.100
[cplayer] ffmpeg version: 4.2.4
[cplayer]
[cplayer] Configuration: /usr/bin/waf configure --prefix=/usr --bindir=/usr/bin --libdir=/usr/lib64 --mandir=/usr/share/man --docdir=/usr/share/doc/mpv --confdir=/etc/mpv
--disable-build-date --enable-libmpv-shared --enable-sdl2 --enable-libarchive --enable-libsmbclient --enable-dvdnav --enable-cdda --enable-html-build --enable-dvbin
[cplayer] List of enabled features: aligned_alloc alsa asm atomics caca cdda cplayer cplugins cuda-hwaccel cuda-interop debug-build drm drmprime dvbin dvdnav egl egl-drm
egl-helpers egl-x11 fchmod ffmpeg ffnvcodec gbm gbm.h gl gl-wayland gl-x11 glibc-thread-name glob glob-posix gnuc gpl iconv jack javascript jpeg lcms2 libarchive libass libass-osd
libav-any libavcodec libavdevice libavutil libbluray libdl libm libmpv-shared libplacebo librt libsmbclient linux-fstatfs lua luajit memfd_create optimize oss-audio plain-gl posix
posix-or-mingw posix-spawn posix-spawn-native pthreads pulse rubberband sdl2 sdl2-audio sdl2-gamepad sdl2-video shaderc shaderc-shared stdatomic uchardet vaapi vaapi-drm
vaapi-egl vaapi-vulkan vaapi-wayland vaapi-x-egl vaapi-x11 vapoursynth vdpau vdpau-gl-x11 vt.h vulkan wayland wayland-protocols x11 xv zimg zlib
[cplayer] Reading config file /etc/mpv/encoding-profiles.conf
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'hwdec' = 'vaapi' (flags = 8)
[cplayer] Setting option 'hwdec-codecs' = 'all' (flags = 8)
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Waiting for scripts...
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
[osd/libass] Shaper: FriBidi 1.0.8 (SIMPLE) HarfBuzz-ng 2.6.4 (COMPLEX)
[osd/libass] Setting up fonts...
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] Done loading scripts.
[cplayer] Running hook: ytdl_hook/on_load
[ytdl_hook] ytdl:// hook
[ytdl_hook] not a ytdl:// url
[ifo_dvdnav] Opening /home/FranceBB/Share Windows Linux/Production/RAW/417-423/417.VOB
Opening /home/FranceBB/Share Windows Linux/Production/RAW/417-423/417.VOB
[file] Opening /home/FranceBB/Share Windows Linux/Production/RAW/417-423/417.VOB
[osd/libass] Shaper: FriBidi 1.0.8 (SIMPLE) HarfBuzz-ng 2.6.4 (COMPLEX)
[osd/libass] Setting up fonts...
[demux] Trying demuxers for level=normal.
[lavf] Found 'mpeg' at score=25 size=2048.
[lavf] Found 'mpeg' at score=26 size=4096.
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] Set property: shared-script-properties -> 1
[file] stream level seek from 4587520 to 1072938864
[file] stream level seek from 1073188864 to 1072688864
[file] stream level seek from 1072951008 to 0
[lavf] avformat_find_stream_info() finished after 0 bytes.
[demux] Detected file format: mpeg (libavformat)
[cplayer] Opening done: /home/FranceBB/Share Windows Linux/Production/RAW/417-423/417.VOB
[find_files] Loading external files in /home/FranceBB/Share Windows Linux/Production/RAW/417-423/
[cplayer] Running hook: ytdl_hook/on_preloaded
[lavf] select track 0
[lavf] select track 1
[cplayer] (+) Video --vid=1 (mpeg2video 720x480 29.970fps)
[cplayer] (+) Audio --aid=1 (ac3 2ch 48000Hz)
[cplayer] Audio --aid=2 (ac3 2ch 48000Hz)
[cplayer] Subs --sid=1 (dvd_subtitle)
[cplayer] Subs --sid=2 (dvd_subtitle)
[vo/gpu] Probing for best GPU context.
[vo/gpu/opengl] Initializing GPU context 'wayland'
[vo/gpu/opengl] Initializing GPU context 'x11egl'
[vo/gpu/x11] X11 opening display: :1
[vo/gpu/x11] Display 0 (eDP1): [0, 0, 1920, 1080] @ 60.007852 FPS
[vo/gpu/x11] Current display FPS: 60.007852
[vo/gpu/opengl] EGL_VERSION=1.5
[vo/gpu/opengl] EGL_VENDOR=Mesa Project
[vo/gpu/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES
[vo/gpu/opengl] Trying to create Desktop OpenGL context.
[vo/gpu/opengl] Choosing visual EGL config 0x15, visual ID 0x20
[vo/gpu/opengl] GL_VERSION='4.6 (Core Profile) Mesa 20.1.8'
[vo/gpu/opengl] Detected desktop OpenGL 4.6.
[vo/gpu/opengl] GL_VENDOR='Intel'
[vo/gpu/opengl] GL_RENDERER='Mesa Intel(R) HD Graphics 530 (SKL GT2)'
[vo/gpu/opengl] GL_SHADING_LANGUAGE_VERSION='4.60'
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu] Assuming 60.007852 FPS for display sync.
[vd] Container reported FPS: 29.970030
[vd] Codec list:
[vd] mpeg2video - MPEG-2 video
[vd] mpegvideo (mpeg2video) - MPEG-1 video
[vd] mpeg2_v4l2m2m (mpeg2video) - V4L2 mem2mem MPEG2 decoder wrapper
[vd] mpeg2_qsv (mpeg2video) - MPEG-2 video (Intel Quick Sync Video acceleration)
[vd] mpeg2_cuvid (mpeg2video) - Nvidia CUVID MPEG2VIDEO decoder
[vd] Opening decoder mpeg2video
[vd] Looking at hwdec mpeg2video-vaapi...
[vo/gpu] Loading hwdec driver 'vaapi-egl'
[vo/gpu/vaapi-egl] using VAAPI EGL interop
[vo/gpu/vaapi-egl] Trying to open a x11 VA display...
[vo/gpu/vaapi-egl/vaapi] Initialized VAAPI: version 1.7
[vo/gpu/vaapi-egl] Going to probe surface formats (may log bogus errors)...
[vo/gpu/vaapi-egl] Done probing surface formats.
[B][vo/gpu] Loading hwdec driver 'cuda-nvdec'
[vo/gpu/cuda-nvdec] cu->cuInit(0) failed -> CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
[vo/gpu] Loading failed.
[vo/gpu] Loading hwdec driver 'vdpau-gl'
[vo/gpu] Loading failed.
[vo/gpu] Loading hwdec driver 'drmprime-drm'
[vo/gpu/drmprime-drm] Failed to retrieve DRM fd from native display.
[vo/gpu] Loading failed.
[vd] Trying hardware decoding via mpeg2video-vaapi.
[vd] Selected codec: mpeg2video (MPEG-2 video)
[vf] User filter list:
[vf] (empty)
[ad] Codec list:
[ad] ac3 - ATSC A/52A (AC-3)
[ad] ac3_fixed (ac3) - ATSC A/52A (AC-3)
[ad] Opening decoder ac3
[ad] Requesting 1 threads for decoding.
[ad] Selected codec: ac3 (ATSC A/52A (AC-3))
[af] User filter list:
[af] (empty)
[cplayer] Starting playback...
[af] [in] 48000Hz stereo 2ch floatp
[af] [userspeed] 48000Hz stereo 2ch floatp
[af] [userspeed] (disabled)
[af] [convert] 48000Hz stereo 2ch floatp
[vd] Pixel formats supported by decoder: cuda vdpau vaapi_vld yuv420p
[vd] Codec profile: Main (0x4)
[vd] Requesting pixfmt 'vaapi_vld' from decoder.
[vd] Using hardware decoding (vaapi).
[vd] Decoder format: 720x480 [32:27] vaapi[nv12] auto/auto/auto/limited/auto CL=mpeg2/4/h264
[vf] [in] 720x480 [32:27] vaapi[nv12] bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [userdeint] 720x480 [32:27] vaapi[nv12] bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [userdeint] (disabled)
[vf] [autorotate] 720x480 [32:27] vaapi[nv12] bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [autorotate] (disabled)
[vf] [convert] 720x480 [32:27] vaapi[nv12] bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [convert] (disabled)
[vf] [out] 720x480 [32:27] vaapi[nv12] bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[ao] Trying audio driver 'pulse'
[ao/pulse] requested format: 48000 Hz, stereo channels, floatp
[ao/pulse] Library version: 13.99.0
[ao/pulse] Proto: 33
[ao/pulse] Server proto: 4294967295
[ao/pulse] Channel layouts:
[ao/pulse] - #fl
[ao/pulse] - #fr
[ao/pulse] - #fc
[ao/pulse] - #lfe
[ao/pulse] - #bl
[ao/pulse] - #br
[ao/pulse] - #flc
[ao/pulse] - #frc
[ao/pulse] - #bc
[ao/pulse] - #sl
[ao/pulse] - #sr
[ao/pulse] - #tc
[ao/pulse] - #tfl
[ao/pulse] - #tfc
[ao/pulse] - #tfr
[ao/pulse] - #tbl
[ao/pulse] - #tbc
[ao/pulse] - #tbr
[ao/pulse] result: stereo
[ao/pulse] device buffer: 4800 samples.
[ao/pulse] using soft-buffer of 9600 samples.
[cplayer] AO: [pulse] 48000Hz stereo 2ch float
[cplayer] AO: Description: PulseAudio audio output
[autoconvert] inserting resampler
[swresample] format change, reinitializing resampler
[swresample] 48000Hz stereo floatp -> 48000Hz stereo float
[af] [out] 48000Hz stereo 2ch float
[cplayer] VO: [gpu] 720x480 => 853x480 vaapi[nv12]
[cplayer] VO: Description: Shader-based GPU Renderer
[vo/gpu] reconfig to 720x480 [32:27] vaapi[nv12] bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vo/gpu/x11] not waiting for MapNotify
[vo/gpu] Resize: 853x480
[vo/gpu] Window size: 853x480 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 720x480 (32:27)
[vo/gpu] Video display: (0, 0) 720x480 -> (0, 0) 853x480
[vo/gpu] Video scale: 1.184722/1.000000
[vo/gpu] OSD borders: l=0 t=0 r=0 b=0
[vo/gpu] Video borders: l=0 t=0 r=0 b=0
[vo/gpu] Reported display depth: 8
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[cplayer] first video frame after restart shown
[cplayer] audio sync: sync_to_video=1, offset=0.000000
[cplayer] starting audio playback
[cplayer] playback restart complete @ 0.000000
[statusline] AV: 00:00:00 / 00:23:09 (0%) A-V: 0.000
[vo/gpu/x11] Disabling screensaver.
[statusline] AV: 00:00:00 / 00:23:09 (0%) A-V: 0.000
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
[statusline] AV: 00:00:00 / 00:23:09 (0%) A-V: 0.000
[osd/libass] fontselect: (sans-serif, 400, 0) -> /usr/share/fonts/Fonts/DejaVuSans.ttf, 0, DejaVuSans
[osd/libass] fontselect: (mpv-osd-symbols, 400, 0) -> mpv-osd-symbols-Regular, 0, mpv-osd-symbols-Regular
[vo/gpu] Reallocating OSD texture to 1024x128.
[statusline] AV: 00:00:00 / 00:23:09 (0%) A-V: 0.000
[cplayer] Set property: shared-script-properties -> 1
[statusline] AV: 00:00:04 / 00:23:09 (0%) A-V: 0.000
[cplayer] Set property: deinterlace -> 1
[vd] Decoder format: 720x480 [32:27] vaapi[nv12] auto/auto/auto/limited/auto CL=mpeg2/4/h264
[autoconvert] HW-downloading from vaapi
[vf] [userdeint] (enabled)
[vf] [autorotate] 720x480 [32:27] yuv420p bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [convert] 720x480 [32:27] yuv420p bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [out] 720x480 [32:27] yuv420p bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[statusline] AV: 00:00:04 / 00:23:09 (0%) A-V: 0.000
[osd/libass] Shaper: FriBidi 1.0.8 (SIMPLE) HarfBuzz-ng 2.6.4 (COMPLEX)
[osd/libass] Setting up fonts...
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[osd/libass] fontselect: (sans-serif, 400, 0) -> /usr/share/fonts/Fonts/DejaVuSans.ttf, 0, DejaVuSans
[vo/gpu] Reallocating OSD texture to 512x128.
[statusline] AV: 00:00:04 / 00:23:09 (0%) A-V: 0.000
[cplayer] VO: [gpu] 720x480 => 853x480 yuv420p
[cplayer] VO: Description: Shader-based GPU Renderer
[vo/gpu] reconfig to 720x480 [32:27] yuv420p bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vo/gpu] Resize: 853x480
[vo/gpu] Window size: 853x480 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 720x480 (32:27)
[vo/gpu] Video display: (0, 0) 720x480 -> (0, 0) 853x480
[vo/gpu] Video scale: 1.184722/1.000000
[vo/gpu] OSD borders: l=0 t=0 r=0 b=0
[vo/gpu] Video borders: l=0 t=0 r=0 b=0
[vo/gpu] Reported display depth: 8
[vo/gpu] Texture for plane 0: 720x480
[vo/gpu] Texture for plane 1: 360x240
[vo/gpu] Texture for plane 2: 360x240
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[statusline] AV: 00:00:07 / 00:23:09 (0%) A-V: 0.000
[cplayer] Set property: shared-script-properties -> 1
[statusline] AV: 00:00:07 / 00:23:09 (0%) A-V: 0.000
[cplayer] Set property: shared-script-properties -> 1
[statusline] AV: 00:00:29 / 00:23:09 (2%) A-V: 0.000

FranceBB
28th September 2020, 19:17
This isn't terribly bad, since it managed to work with vaapi and is using the integrated graphic card of my CPU, however I would have been happier if it used the dedicated NVIDIA 950M instead. Why is it using the integrated graphic over the NVIDIA one?
And most importantly: I'm pretty interested in the HEVC H.265 hardware decoding support.
My NVIDIA 950M doesn't support HEVC decoding, so I don't really mind of MPV not using it with 4K contents, however, afaik, my Intel HD Graphics 530 should support it in decoding:


Hardware codec support
h264: Decode
h265 / HEVC (8 bit): Decode
h265 / HEVC (10 bit): Decode
VP8: Decode
VP9: Decode
VC-1:Decode
AVC: Decode
JPEG: Decode


so, I was expecting it to be used in decoding on an m2ts I extracted from a brand new UHD-BD, but it doesn't and everything is stuttering as hell with the CPU at 100% on all cores/threads and even if I turn the Turbo Boost (overclock) on, it still lags behind and doesn't manage to properly decode it.

This is the Dolby Vision BD:

General
ID : 0 (0x0)
Complete name : D:\00000.m2ts
Format : BDAV
Format/Info : Blu-ray Video
File size : 77.2 GiB
Duration : 1 h 57 min
Overall bit rate mode : Variable
Overall bit rate : 94.4 Mb/s
Maximum Overall bit rate : 109 Mb/s

Video #1
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L5.1@High
HDR format : SMPTE ST 2086, HDR10 compatible
Codec ID : 36
Duration : 1 h 57 min
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate : 59.940 (60000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0 (Type 2)
Bit depth : 10 bits
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : PQ
Matrix coefficients : BT.2020 non-constant
Mastering display color primaries : Display P3
Mastering display luminance : min: 0.0010 cd/m2, max: 1000 cd/m2
Maximum Content Light Level : 5180 cd/m2
Maximum Frame-Average Light Level : 1577 cd/m2

Video #2
ID : 4117 (0x1015)
Menu ID : 1 (0x1)
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L5.1@High
HDR format : SMPTE ST 2086, HDR10 compatible
Codec ID : 36
Duration : 1 h 57 min
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 59.940 (60000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0 (Type 2)
Bit depth : 10 bits
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : PQ
Matrix coefficients : BT.2020 non-constant
Mastering display color primaries : Display P3
Mastering display luminance : min: 0.0010 cd/m2, max: 1000 cd/m2

Audio #1
ID : 4352 (0x1100)
Menu ID : 1 (0x1)
Format : AC-3
Format/Info : Audio Coding 3
Commercial name : Dolby Digital
Codec ID : 129
Duration : 1 h 57 min
Bit rate mode : Constant
Bit rate : 640 kb/s
Channel(s) : 6 channels
Channel layout : L R C LFE Ls Rs
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Compression mode : Lossy
Stream size : 536 MiB (1%)
Service kind : Complete Main

Audio #2
ID : 4353 (0x1101)
Menu ID : 1 (0x1)
Format : AC-3 MLP FBA 16-ch
Format/Info : Audio Coding 3 + Meridian Lossless Packing FBA with 16-channel presentation
Commercial name : Dolby TrueHD with Dolby Atmos
Muxing mode : Stream extension
Codec ID : 131
Duration : 1 h 57 min
Bit rate mode : Variable
Bit rate : 640 kb/s
Maximum bit rate : 7 944 kb/s
Channel(s) : 8 channels
Channel layout : L R C LFE Ls Rs Lb Rb
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Compression mode : Lossy
Stream size : 536 MiB (1%)
Service kind : Complete Main
Number of dynamic objects : 11
Bed channel count : 1 channel
Bed channel configuration : LFE

FranceBB
28th September 2020, 19:19
And this is what happens when I try to decode it with MPV:


[FranceBB@router-localhost ~]$ mpv -hwdec=vaapi --hwdec-codecs=all -vo opengl -v "/home/FranceBB/D/00000.m2ts"
[cplayer] Command line options: '-hwdec=vaapi' '--hwdec-codecs=all' '-vo' 'opengl' '-v' '/home/FranceBB/D/00000.m2ts'
[cplayer] mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
[cplayer] built on UNKNOWN
[cplayer] ffmpeg library versions:
[cplayer] libavutil 56.31.100
[cplayer] libavcodec 58.54.100
[cplayer] libavformat 58.29.100
[cplayer] libswscale 5.5.100
[cplayer] libavfilter 7.57.100
[cplayer] libswresample 3.5.100
[cplayer] ffmpeg version: 4.2.4
[cplayer]
[cplayer] Configuration: /usr/bin/waf configure --prefix=/usr --bindir=/usr/bin --libdir=/usr/lib64 --mandir=/usr/share/man --docdir=/usr/share/doc/mpv --confdir=/etc/mpv --disable-build-date
--enable-libmpv-shared --enable-sdl2 --enable-libarchive --enable-libsmbclient --enable-dvdnav --enable-cdda --enable-html-build --enable-dvbin
[cplayer] List of enabled features: aligned_alloc alsa asm atomics caca cdda cplayer cplugins cuda-hwaccel cuda-interop debug-build drm drmprime
dvbin dvdnav egl egl-drm egl-helpers egl-x11 fchmod ffmpeg ffnvcodec gbm gbm.h gl gl-wayland gl-x11 glibc-thread-name glob glob-posix gnuc gpl iconv
jack javascript jpeg lcms2 libarchive libass libass-osd libav-any libavcodec libavdevice libavutil libbluray libdl libm libmpv-shared libplacebo librt libsmbclient
linux-fstatfs lua luajit memfd_create optimize oss-audio plain-gl posix posix-or-mingw posix-spawn posix-spawn-native pthreads pulse rubberband sdl2 sdl2-audio
sdl2-gamepad sdl2-video shaderc shaderc-shared stdatomic uchardet vaapi vaapi-drm vaapi-egl vaapi-vulkan vaapi-wayland vaapi-x-egl vaapi-x11 vapoursynth vdpau
vdpau-gl-x11 vt.h vulkan wayland wayland-protocols x11 xv zimg zlib
[cplayer] Reading config file /etc/mpv/encoding-profiles.conf
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'hwdec' = 'vaapi' (flags = 8)
[cplayer] Setting option 'hwdec-codecs' = 'all' (flags = 8)
[cplayer] The legacy option syntax ('-vo value') is deprecated and dangerous.
[cplayer] Please use '--vo=value'.
[cplayer] Setting option 'vo' = 'opengl' (flags = 8)
[cplayer] Driver 'opengl' has been replaced with 'gpu'!
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Waiting for scripts...
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
[osd/libass] Shaper: FriBidi 1.0.8 (SIMPLE) HarfBuzz-ng 2.6.4 (COMPLEX)
[osd/libass] Setting up fonts...
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] Done loading scripts.
[cplayer] Running hook: ytdl_hook/on_load
[ytdl_hook] ytdl:// hook
[ytdl_hook] not a ytdl:// url
[ifo_dvdnav] Opening /home/FranceBB/D/00000.m2ts
Opening /home/FranceBB/D/00000.m2ts
[osd/libass] Shaper: FriBidi 1.0.8 (SIMPLE) HarfBuzz-ng 2.6.4 (COMPLEX)
[file] Opening /home/FranceBB/D/00000.m2ts
[osd/libass] Setting up fonts...
[demux] Trying demuxers for level=normal.
[lavf] Found 'mpegts' at score=50 size=2048.
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] Set property: shared-script-properties -> 1
[ffmpeg/video] hevc: Skipping NAL unit 62
[file] stream level seek from 262144 to 82919567216
[file] stream level seek from 82919698288 to 82919550832
[file] stream level seek from 82919817216 to 82919317216
[file] stream level seek from 82919448288 to 82919300832
[file] stream level seek from 82919628512 to 0
[lavf] avformat_find_stream_info() finished after 0 bytes.
[demux] Detected file format: mpegts (libavformat)
[cplayer] Opening done: /home/FranceBB/D/00000.m2ts
[find_files] Loading external files in /home/FranceBB/D/
[cplayer] Running hook: ytdl_hook/on_preloaded
[lavf] select track 0
[lavf] select track 2
[cplayer] (+) Video --vid=1 (hevc 3840x2160 59.940fps)
[cplayer] Video --vid=2 (hevc 1920x1080 59.940fps)
[cplayer] (+) Audio --aid=1 (ac3 6ch 48000Hz)
[cplayer] Audio --aid=2 (truehd 8ch 48000Hz)
[cplayer] Audio --aid=3 (ac3 6ch 48000Hz)
[vo/opengl] Probing for best GPU context.
[vo/opengl/opengl] Initializing GPU context 'wayland'
[vo/opengl/opengl] Initializing GPU context 'x11egl'
[vo/opengl/x11] X11 opening display: :1
[vo/opengl/x11] Display 0 (eDP1): [0, 0, 1920, 1080] @ 60.007852 FPS
[vo/opengl/x11] Current display FPS: 60.007852
[vo/opengl/opengl] EGL_VERSION=1.5
[vo/opengl/opengl] EGL_VENDOR=Mesa Project
[vo/opengl/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES
[vo/opengl/opengl] Trying to create Desktop OpenGL context.
[vo/opengl/opengl] Choosing visual EGL config 0x15, visual ID 0x20
[vo/opengl/opengl] GL_VERSION='4.6 (Core Profile) Mesa 20.1.8'
[vo/opengl/opengl] Detected desktop OpenGL 4.6.
[vo/opengl/opengl] GL_VENDOR='Intel'
[vo/opengl/opengl] GL_RENDERER='Mesa Intel(R) HD Graphics 530 (SKL GT2)'
[vo/opengl/opengl] GL_SHADING_LANGUAGE_VERSION='4.60'
[vo/opengl] Testing FBO format rgba16f
[vo/opengl] Using FBO format rgba16f.
[vo/opengl] No advanced processing required. Enabling dumb mode.
[vo/opengl] Assuming 60.007852 FPS for display sync.
[vd] Container reported FPS: 59.940060
[B][vd] Codec list:
[vd] hevc - HEVC (High Efficiency Video Coding)
[vd] hevc_qsv (hevc) - HEVC (Intel Quick Sync Video acceleration)
[vd] hevc_v4l2m2m (hevc) - V4L2 mem2mem HEVC decoder wrapper
[vd] hevc_cuvid (hevc) - Nvidia CUVID HEVC decoder
[vd] Opening decoder hevc
[vd] Looking at hwdec hevc-vaapi...
[vo/opengl] Loading hwdec driver 'vaapi-egl'
[vo/opengl/vaapi-egl] using VAAPI EGL interop
[vo/opengl/vaapi-egl] Trying to open a x11 VA display...
[vo/opengl/vaapi-egl/vaapi] Initialized VAAPI: version 1.7
[vo/opengl/vaapi-egl] Going to probe surface formats (may log bogus errors)...
[vo/opengl/vaapi-egl] Done probing surface formats.
[vo/opengl] Loading hwdec driver 'cuda-nvdec'
[vo/opengl/cuda-nvdec] cu->cuInit(0) failed -> CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
[vo/opengl] Loading failed.
[vo/opengl] Loading hwdec driver 'vdpau-gl'
[vo/opengl] Loading failed.
[vo/opengl] Loading hwdec driver 'drmprime-drm'
[vo/opengl/drmprime-drm] Failed to retrieve DRM fd from native display.
[vo/opengl] Loading failed.
[vd] Trying hardware decoding via hevc-vaapi.
[vd] Selected codec: hevc (HEVC (High Efficiency Video Coding))
[vf] User filter list:
[vf] (empty)
[ad] Codec list:
[ad] ac3 - ATSC A/52A (AC-3)
[ad] ac3_fixed (ac3) - ATSC A/52A (AC-3)
[ad] Opening decoder ac3
[ad] Requesting 1 threads for decoding.
[ad] Selected codec: ac3 (ATSC A/52A (AC-3))
[af] User filter list:
[af] (empty)
[cplayer] Starting playback...
[vd] Pixel formats supported by decoder: vaapi_vld cuda yuv420p10le
[vd] Codec profile: Main 10 (0x2)
[vd] Hardware decoding of this stream is unsupported?
[vd] Requesting pixfmt 'yuv420p10le' from decoder.
[vd] Falling back to software decoding.
[vd] Detected 8 logical cores.
[vd] Requesting 9 threads for decoding.
[vd] Using software decoding.
[vd] Decoder format: 3840x2160 yuv420p10 bt.2020-ncl/bt.2020/pq/limited/auto SP=51.799999 CL=unknown
[vf] [in] 3840x2160 yuv420p10 bt.2020-ncl/bt.2020/pq/limited/display SP=51.799999 CL=mpeg2/4/h264
[vf] [userdeint] 3840x2160 yuv420p10 bt.2020-ncl/bt.2020/pq/limited/display SP=51.799999 CL=mpeg2/4/h264
[vf] [userdeint] (disabled)
[vf] [autorotate] 3840x2160 yuv420p10 bt.2020-ncl/bt.2020/pq/limited/display SP=51.799999 CL=mpeg2/4/h264
[vf] [autorotate] (disabled)
[vf] [convert] 3840x2160 yuv420p10 bt.2020-ncl/bt.2020/pq/limited/display SP=51.799999 CL=mpeg2/4/h264
[vf] [convert] (disabled)
[vf] [out] 3840x2160 yuv420p10 bt.2020-ncl/bt.2020/pq/limited/display SP=51.799999 CL=mpeg2/4/h264
[af] [in] 48000Hz 5.1(side) 6ch floatp
[af] [userspeed] 48000Hz 5.1(side) 6ch floatp
[af] [userspeed] (disabled)
[af] [convert] 48000Hz 5.1(side) 6ch floatp
[ao] Trying audio driver 'pulse'
[ao/pulse] requested format: 48000 Hz, 5.1(side) channels, floatp
[ao/pulse] Library version: 13.99.0
[ao/pulse] Proto: 33
[ao/pulse] Server proto: 4294967295
[ao/pulse] Channel layouts:
[ao/pulse] - #fl
[ao/pulse] - #fr
[ao/pulse] - #fc
[ao/pulse] - #lfe
[ao/pulse] - #bl
[ao/pulse] - #br
[ao/pulse] - #flc
[ao/pulse] - #frc
[ao/pulse] - #bc
[ao/pulse] - #sl
[ao/pulse] - #sr
[ao/pulse] - #tc
[ao/pulse] - #tfl
[ao/pulse] - #tfc
[ao/pulse] - #tfr
[ao/pulse] - #tbl
[ao/pulse] - #tbc
[ao/pulse] - #tbr
[ao/pulse] result: 5.1(side)
[ao/pulse] device buffer: 4800 samples.
[ao/pulse] using soft-buffer of 9600 samples.
[cplayer] AO: [pulse] 48000Hz 5.1(side) 6ch float
[cplayer] AO: Description: PulseAudio audio output
[autoconvert] inserting resampler
[swresample] format change, reinitializing resampler
[swresample] 48000Hz 5.1(side) floatp -> 48000Hz 5.1(side) float
[af] [out] 48000Hz 5.1(side) 6ch float
[cplayer] VO: [gpu] 3840x2160 yuv420p10
[cplayer] VO: Description: Shader-based GPU Renderer
[vo/opengl] reconfig to 3840x2160 yuv420p10 bt.2020-ncl/bt.2020/pq/limited/display SP=51.799999 CL=mpeg2/4/h264
[vo/opengl/x11] not waiting for MapNotify
[vo/opengl] Resize: 1920x1016
[vo/opengl] Window size: 1920x1016 (Borders: l=0 t=0 r=0 b=0)
[vo/opengl] Video source: 3840x2160 (1:1)
[vo/opengl] Video display: (0, 0) 3840x2160 -> (57, 0) 1806x1016
[vo/opengl] Video scale: 0.470313/0.470370
[vo/opengl] OSD borders: l=57 t=0 r=57 b=0
[vo/opengl] Video borders: l=57 t=0 r=57 b=0
[vo/opengl] Reported display depth: 8
[vo/opengl] Texture for plane 0: 3840x2160
[vo/opengl] Texture for plane 1: 1920x1080
[vo/opengl] Texture for plane 2: 1920x1080
[vo/opengl] Testing FBO format rgba16f
[vo/opengl] Using FBO format rgba16f.
[vo/opengl] No advanced processing required. Enabling dumb mode.
[vo/opengl] DR enabled: yes
[cplayer] first video frame after restart shown
[cplayer] audio sync: sync_to_video=1, offset=0.000000
[cplayer] starting audio playback
[cplayer] playback restart complete @ 0.000000
[cplayer] Set property: shared-script-properties -> 1
[statusline] AV: 00:00:00 / 01:57:03 (0%) A-V: 0.000
[cplayer] Set property: shared-script-properties -> 1
[vo/opengl] Resize: 1920x1016
[vo/opengl] Window size: 1920x1016 (Borders: l=0 t=0 r=0 b=0)
[vo/opengl] Video source: 3840x2160 (1:1)
[vo/opengl] Video display: (0, 0) 3840x2160 -> (57, 0) 1806x1016
[vo/opengl] Video scale: 0.470313/0.470370
[vo/opengl] OSD borders: l=57 t=0 r=57 b=0
[vo/opengl] Video borders: l=57 t=0 r=57 b=0
[vo/opengl] Reported display depth: 8
[vo/opengl/x11] Disabling screensaver.
[statusline] AV: 00:00:01 / 01:57:03 (0%) A-V: 0.399 Dropped: 67
[cplayer]
[cplayer] Audio/Video desynchronisation detected! Possible reasons include too slow
[cplayer] hardware, temporary CPU spikes, broken drivers, and broken files. Audio
[cplayer] position will not match to the video (see A-V status field).
[cplayer]
[statusline] AV: 00:00:01 / 01:57:03 (0%) A-V: 0.564 Dropped: 68
[cplayer] Set property: fullscreen -> 1
[vo/opengl] Resize: 1920x1016
[vo/opengl] Window size: 1920x1016 (Borders: l=0 t=0 r=0 b=0)
[vo/opengl] Video source: 3840x2160 (1:1)
[vo/opengl] Video display: (0, 0) 3840x2160 -> (57, 0) 1806x1016
[vo/opengl] Video scale: 0.470313/0.470370
[vo/opengl] OSD borders: l=57 t=0 r=57 b=0
[vo/opengl] Video borders: l=57 t=0 r=57 b=0
[vo/opengl] Reported display depth: 8
[statusline] AV: 00:00:01 / 01:57:03 (0%) A-V: 0.534 Dropped: 70
[cplayer] Set property: shared-script-properties -> 1
[statusline] AV: 00:00:01 / 01:57:03 (0%) A-V: 0.507 Dropped: 72
[vo/opengl] Resize: 1920x1080
[vo/opengl] Window size: 1920x1080 (Borders: l=0 t=0 r=0 b=0)
[vo/opengl] Video source: 3840x2160 (1:1)
[vo/opengl] Video display: (0, 0) 3840x2160 -> (0, 0) 1920x1080
[vo/opengl] Video scale: 0.500000/0.500000
[vo/opengl] OSD borders: l=0 t=0 r=0 b=0
[vo/opengl] Video borders: l=0 t=0 r=0 b=0
[vo/opengl] Reported display depth: 8
[statusline] AV: 00:00:01 / 01:57:03 (0%) A-V: 0.601 Dropped: 76
[cplayer] Set property: shared-script-properties -> 1
[statusline] AV: 00:00:33 / 01:57:03 (0%) A-V: 11.009 Dropped: 1675
[vo/opengl] Resize: 1920x1080
[vo/opengl] Window size: 1920x1080 (Borders: l=0 t=0 r=0 b=0)
[vo/opengl] Video source: 3840x2160 (1:1)
[vo/opengl] Video display: (0, 0) 3840x2160 -> (0, 0) 1920x1080
[vo/opengl] Video scale: 0.500000/0.500000
[vo/opengl] OSD borders: l=0 t=0 r=0 b=0
[vo/opengl] Video borders: l=0 t=0 r=0 b=0
[cplayer] Set property: fullscreen=no -> 1
[vo/opengl] Reported display depth: 8
[statusline] AV: 00:00:33 / 01:57:03 (0%) A-V: 10.997 Dropped: 1676
[cplayer] Set property: shared-script-properties -> 1
[vo/opengl] Resize: 1920x1016
[vo/opengl] Window size: 1920x1016 (Borders: l=0 t=0 r=0 b=0)
[vo/opengl] Video source: 3840x2160 (1:1)
[vo/opengl] Video display: (0, 0) 3840x2160 -> (57, 0) 1806x1016
[vo/opengl] Video scale: 0.470313/0.470370
[vo/opengl] OSD borders: l=57 t=0 r=57 b=0
[vo/opengl] Video borders: l=57 t=0 r=57 b=0
[vo/opengl] Reported display depth: 8
[statusline] AV: 00:00:33 / 01:57:03 (0%) A-V: 10.999 Dropped: 1678
[cplayer] Set property: shared-script-properties -> 1
[statusline] AV: 00:00:38 / 01:57:03 (0%) A-V: 13.008 Dropped: 1955


As you can see, it doesn't find any CUDA capable decoding hardware 'cause my NVIDIA doesn't support HEVC Decoding, however when it tries to use the Intel HD 530 using vaapi, it doesn't work as it says that decoding for this profile is not supported. Why?


p.s this was supposed to be a single post, but I had to split it due to the long logs file and the forum character limitation. Sorry about that.


As always, thank you in advance,
Frank