Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing profiles for encoding/decoding with hwaccel for ffmpeg inside lxc container #4334

Open
miguelcarmona opened this issue Aug 22, 2023 · 3 comments

Comments

@miguelcarmona
Copy link

miguelcarmona commented Aug 22, 2023

Required information

  • Distribution: Ubuntu
  • Distribution version: Focal 20.04
  • The output of
    • lxc-start --version
      4.0.12
    • lxc-checkconfig
LXC version 4.0.12
Kernel configuration not found at /proc/config.gz; searching...
Kernel configuration found at /boot/config-5.4.0-155-generic
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled

--- Control groups ---
Cgroups: enabled
Cgroup namespace: enabled

Cgroup v1 mount points: 
/sys/fs/cgroup/systemd
/sys/fs/cgroup/blkio
/sys/fs/cgroup/cpu,cpuacct
/sys/fs/cgroup/net_cls,net_prio
/sys/fs/cgroup/cpuset
/sys/fs/cgroup/freezer
/sys/fs/cgroup/devices
/sys/fs/cgroup/hugetlb
/sys/fs/cgroup/rdma
/sys/fs/cgroup/perf_event
/sys/fs/cgroup/memory
/sys/fs/cgroup/pids

Cgroup v2 mount points: 
/sys/fs/cgroup/unified

Cgroup v1 clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled

--- Misc ---
Veth pair device: enabled, loaded
Macvlan: enabled, not loaded
Vlan: enabled, loaded
Bridges: enabled, loaded
Advanced netfilter: enabled, loaded
CONFIG_IP_NF_TARGET_MASQUERADE: enabled, not loaded
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled, not loaded
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled, not loaded
CONFIG_NETFILTER_XT_MATCH_COMMENT: enabled, not loaded
FUSE (for use with lxcfs): enabled, not loaded

--- Checkpoint/Restore ---
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled
CONFIG_NETLINK_DIAG: enabled
File capabilities: 

Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig
  • uname -a
Linux maestro 5.4.0-155-generic #172-Ubuntu SMP Fri Jul 7 16:10:02 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • cat /proc/self/cgroup
12:pids:/user.slice/user-0.slice/session-17181.scope
11:memory:/user.slice/user-0.slice/session-17181.scope
10:perf_event:/
9:rdma:/
8:hugetlb:/
7:devices:/user.slice
6:freezer:/user/root/0
5:cpuset:/
4:net_cls,net_prio:/
3:cpu,cpuacct:/user.slice
2:blkio:/user.slice
1:name=systemd:/user.slice/user-0.slice/session-17181.scope
0::/user.slice/user-0.slice/session-17181.scope
  • cat /proc/1/mounts
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,noexec,relatime,size=15850132k,nr_inodes=3962533,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,nodev,noexec,relatime,size=3179252k,mode=755 0 0
/dev/sda2 / ext4 rw,relatime 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
cgroup2 /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
none /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset,clone_children 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0
cgroup /sys/fs/cgroup/rdma cgroup rw,nosuid,nodev,noexec,relatime,rdma 0 0
cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=16967 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0
mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0
sunrpc /run/rpc_pipefs rpc_pipefs rw,relatime 0 0
configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
lxcfs /var/lib/lxcfs fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
tmpfs /run/user/0 tmpfs rw,nosuid,nodev,relatime,size=3179248k,mode=700 0 0
tracefs /sys/kernel/debug/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0

Issue description

I have less profiles on vainfo inside lxc container.

vainfo output on main machine (ubuntu 20.04):

error: can't connect to X server!
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_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.6.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 20.1.1 ()
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

vainfo output on lxc container (ubuntu 20.04)

error: can't connect to X server!
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_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.6.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 20.1.1 ()
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD

I have a Intel® Iris® 540 integrated GPU (i5-6260U Skylake)

I have tried several configurations for lxc container:

  1. Only in container/config
lxc.cgroup.devices.allow = c 226:0 rwm
lxc.cgroup.devices.allow = c 226:128 rwm
lxc.mount.entry = /dev/dri dev/dri none bind,create=dir
  1. With a external script
  • In container/config
lxc.cgroup.devices.allow = c 226:0 rwm
lxc.cgroup.devices.allow = c 226:128 rwm
lxc.hook.autodev = /var/lib/lxc/gpu.autodev
  • In /var/lib/lxc/gpu.autodev
#!/bin/bash
cd ${LXC_ROOTFS_MOUNT}/dev
mkdir dri
mknod -m 0666 dri/renderD128 c 226 128
mknod -m 0666 dri/card0 c 226 0

I always have the same result.

I have check on another container with the jammy version (22.04) of ubuntu with same exact result.

lxc-create -n ffmpeg2 -t ubuntu -B dir -- --release jammy --arch amd64 --user ffmpeg --packages "htop,net-tools,nano,screen,wget,curl,bind9-dnsutils"

On all machines I always use the root user

Steps to reproduce

  1. Install lxc in main machine (ubuntu 20.04)
apt install lxc lxc-templates
  1. Create lxc container
lxc-create -n ffmpeg -t ubuntu -B dir -- --release focal --arch amd64 --
user ffmpeg --packages "htop,net-tools,nano,screen,wget,curl,bind9-dnsutils"
  1. Update lxc container config file as in the previous steps.
  2. Install vainfo inside lxc container

Information to attach

  • Any relevant kernel output (dmesg)
[1058720.119937] br0: port 5(veth2PNGX0) entered disabled state
[1058720.120000] device veth2PNGX0 entered promiscuous mode
[1058720.120109] br0: port 5(veth2PNGX0) entered blocking state
[1058720.120110] br0: port 5(veth2PNGX0) entered forwarding state
[1058720.122096] br0: port 5(veth2PNGX0) entered disabled state
[1058720.123217] eth0: renamed from vethDb1VRX
[1058720.148653] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[1058720.148688] IPv6: ADDRCONF(NETDEV_CHANGE): veth2PNGX0: link becomes ready
[1058720.148735] br0: port 5(veth2PNGX0) entered blocking state
[1058720.148736] br0: port 5(veth2PNGX0) entered forwarding state
  • Container log (The file from running lxc-start -n <c> -l TRACE -o <logfile> )
    lxc-start.log

  • The containers configuration file

# Template used to create this container: /usr/share/lxc/templates/lxc-ubuntu
# Parameters passed to the template: --release focal --arch amd64 --user ffmpeg --packages htop,net-tools,nano,screen,wget,curl,bind9-dnsutils
# For additional config options, please look at lxc.container.conf(5)

# Uncomment the following line to support nesting containers:
#lxc.include = /usr/share/lxc/config/nesting.conf
# (Be aware this has security implications)


# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf

# Container specific configuration
lxc.rootfs.path = dir:/var/lib/lxc/ffmpeg/rootfs
lxc.uts.name = ffmpeg
lxc.arch = amd64

# Network configuration
lxc.net.0.type = veth
lxc.net.0.link = br0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:c3:57:fb

lxc.apparmor.profile=unconfined

lxc.cgroup.devices.allow = c 226:0 rwm
lxc.cgroup.devices.allow = c 226:128 rwm
lxc.mount.entry = /dev/dri dev/dri none bind,create=dir
@miguelcarmona miguelcarmona changed the title Less vainfo profiles inside lxc container Missing profiles for encoding/decoding with hwaccel for ffmpeg inside lxc container Aug 22, 2023
@miguelcarmona
Copy link
Author

miguelcarmona commented Aug 22, 2023

With ffmpeg, I can decode/encode with all profiles but not inside lxc:
No usable encoding entrypoint found for profile VAProfileHEVCMain (17).

Launching this command:

ffmpeg -vaapi_device /dev/dri/renderD128 -i infile.mkv -vf 'format=nv12,hwupload' 
-map 0:0 -c:v hevc_vaapi -map 0:a -c:a copy -rc_mode CQP -global_quality 20 -profile:v main -v verbose outfile.mkv
  • On main machine:
ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disabl
e-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-li
bcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp
3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-
libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx2
65 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-l
ibdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[AVHWDeviceContext @ 0x558b6f904a00] libva: VA-API version 1.7.0
[AVHWDeviceContext @ 0x558b6f904a00] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x558b6f904a00] libva: Found init function __vaDriverInit_1_7
[AVHWDeviceContext @ 0x558b6f904a00] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x558b6f904a00] Initialised VAAPI connection: version 1.7
[AVHWDeviceContext @ 0x558b6f904a00] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 20.1.1 ().
[AVHWDeviceContext @ 0x558b6f904a00] Driver not found in known nonstandard list, using standard behaviour.
[h264 @ 0x558b6f9594c0] Reinit context to 1920x816, pix_fmt: yuv420p
[matroska,webm @ 0x558b6f91c340] Could not find codec parameters for stream 8 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for Input Stream #0.2 : 5.1
Input #0, matroska,webm, from 'infile.mkv':
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_vaapi))
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
  Stream #0:3 -> #0:3 (copy)
  Stream #0:4 -> #0:4 (copy)
Press [q] to stop, [?] for help
[h264 @ 0x555ffc8f4440] Reinit context to 1920x816, pix_fmt: yuv420p
[graph 0 input from stream 0:0 @ 0x558b702f6c40] w:1920 h:804 pixfmt:yuv420p tb:1/1000 fr:24000/1001 sar:1/1 sws_param:flags=2
[auto_scaler_0 @ 0x558b702f6180] w:iw h:ih flags:'bicubic' interl:0
[Parsed_format_0 @ 0x558b702f5a00] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_format_0'
[auto_scaler_0 @ 0x558b702f6180] w:1920 h:804 fmt:yuv420p sar:1/1 -> w:1920 h:804 fmt:nv12 sar:1/1 flags:0x4
[hevc_vaapi @ 0x558b6f981880] Input surface format is nv12.
[hevc_vaapi @ 0x558b6f981880] Using VAAPI profile VAProfileHEVCMain (17).
[hevc_vaapi @ 0x558b6f981880] Using VAAPI entrypoint VAEntrypointEncSlice (6).
[hevc_vaapi @ 0x558b6f981880] Using VAAPI render target format YUV420 (0x1).
[hevc_vaapi @ 0x558b6f981880] RC mode: CQP.
[hevc_vaapi @ 0x558b6f981880] RC quality: 20.
[hevc_vaapi @ 0x558b6f981880] RC framerate: 24000/1001 (23.98 fps).
[hevc_vaapi @ 0x558b6f981880] Using intra, P- and B-frames (supported references: 3 / 1).
[hevc_vaapi @ 0x558b6f981880] All wanted packed headers available (wanted 0xd, found 0x1f).
[hevc_vaapi @ 0x558b6f981880] Using level 4.
Output #0, matroska, to 'outfile.mkv':
......

Works ok and recode with hw acceleration at 4x (checked with intel_gpu_top).
Without hwaccel, I have 0,5x

  • On container:
ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[AVHWDeviceContext @ 0x5586d3111a00] libva: VA-API version 1.7.0
[AVHWDeviceContext @ 0x5586d3111a00] libva: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x5586d3111a00] libva: Found init function __vaDriverInit_1_7
[AVHWDeviceContext @ 0x5586d3111a00] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x5586d3111a00] Initialised VAAPI connection: version 1.7
[AVHWDeviceContext @ 0x5586d3111a00] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 20.1.1 ().
[AVHWDeviceContext @ 0x5586d3111a00] Driver not found in known nonstandard list, using standard behaviour.
[h264 @ 0x5586d3163740] Reinit context to 1920x816, pix_fmt: yuv420p
[matroska,webm @ 0x5586d314b040] Could not find codec parameters for stream 8 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for Input Stream #0.2 : 5.1
Input #0, matroska,webm, from 'infile.mkv':
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_vaapi))
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
  Stream #0:3 -> #0:3 (copy)
  Stream #0:4 -> #0:4 (copy)
Press [q] to stop, [?] for help
[h264 @ 0x5586d324a680] Reinit context to 1920x816, pix_fmt: yuv420p
[graph 0 input from stream 0:0 @ 0x5586d3b02100] w:1920 h:804 pixfmt:yuv420p tb:1/1000 fr:24000/1001 sar:1/1 sws_param:flags=2
[auto_scaler_0 @ 0x5586d3aff240] w:iw h:ih flags:'bicubic' interl:0
[Parsed_format_0 @ 0x5586d3b00ec0] auto-inserting filter 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_format_0'
[auto_scaler_0 @ 0x5586d3aff240] w:1920 h:804 fmt:yuv420p sar:1/1 -> w:1920 h:804 fmt:nv12 sar:1/1 flags:0x4
[hevc_vaapi @ 0x5586d36f4e40] Input surface format is nv12.
[hevc_vaapi @ 0x5586d36f4e40] Using VAAPI profile VAProfileHEVCMain (17).
[hevc_vaapi @ 0x5586d36f4e40] No usable encoding entrypoint found for profile VAProfileHEVCMain (17).
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[AVIOContext @ 0x5586d318aec0] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x5586d3126540] Statistics: 5065722 bytes read, 2 seeks
Conversion failed!

Fail and exit

@mihalicyn
Copy link
Member

Hi Miguel,

unfortunately I can't give a specific instructions for your case. But I can give you a hint that allows to find a way :)

First of all you need to understand what your application needs and does, easiest way is to use strace.
You can run it like that strace -f -e open,openat -o strace.log ffmpeg -vaapi_device /dev/dri/renderD128 -i infile.mkv -vf 'format=nv12,hwupload',
this will allow you to see which files/devices ffmpeg opens. It's quite obvious that you need to passthrough /dev/dri/renderD128 somehow. But who knows, may be there is something else.

@hallyn
Copy link
Member

hallyn commented Oct 4, 2023

If you find the fix for your issue, please do detail it here for the next person (https://xkcd.com/979/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants