Gavin H
New Member
I'm running OBS 25.0.8 on a physical (hetzner.de) Ubuntu 20.04 remote server inside 'TigerVNC Server' - the 'desktop' session does not have acceleration via the usual X11 GLX mechanism, however access via VAAPI on the commandline works fine.
e.g. this command works perfectly from an XFCE Terminal and eats very few CPU %
If I select 'Video Encoder' as libx264 in OBS, it does work and send the video to the correct place, but of course it's using software libx264 encoding with high CPU %. If I change the Video Encoder to h264_vaapi I receive the generic error:
How can I shoehorn the extra 'magic incantations' regarding init_hw_device and 'format=nv12,hwupload' to the Output -> Recording -> Custom FFMPEG panel?
Cheers,
Gavin.
Code:
dj@Ubuntu-2004-focal-64-minimal:~$ vainfo --display drm | grep H264.*Enc
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
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
e.g. this command works perfectly from an XFCE Terminal and eats very few CPU %
Code:
ffmpeg -init_hw_device vaapi=vaapi:/dev/dri/renderD128 -filter_hw_device vaapi -i rtmp://myserver/path/to/stream -c:v h264_vaapi -vf "format=nv12,hwupload" -y output.mp4
If I select 'Video Encoder' as libx264 in OBS, it does work and send the video to the correct place, but of course it's using software libx264 encoding with high CPU %. If I change the Video Encoder to h264_vaapi I receive the generic error:
Code:
11:37:42 PM.338: Failed to open video codec: Invalid argument
11:37:42 PM.338: ffmpeg_data_init failed
11:37:42 PM.358: ==== Recording Stop ================================================
How can I shoehorn the extra 'magic incantations' regarding init_hw_device and 'format=nv12,hwupload' to the Output -> Recording -> Custom FFMPEG panel?
Cheers,
Gavin.