Project

General

Profile

using GPU transcoder acceleration without having X11 console loaded?

Added by Paul M about 3 years ago

my TVH server has an AMD Ryzen 4300GE so has a Vega GPU, I'm running it on Ubuntu 20.04-LTS

if I try use ffmpeg to transcode a recording it says there's no video device (running as root to avoid permission problems). Since this is running headless in a cupboard, I have no desktop installed so there's no desktop or X11 running.

# time ffmpeg -hwaccel vaapi  -i file.ts file.hw.mp4
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.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
[mpeg2video @ 0x55dd256fa6c0] Invalid frame dimensions 0x0.
    Last message repeated 22 times
[mpegts @ 0x55dd256f56c0] PES packet size mismatch
Input #0, mpegts, from 'Click-27.ts':
  Duration: 00:27:52.12, start: 30576.228644, bitrate: 2402 kb/s
  Program 1 
    Metadata:
      service_name    : blahblahblah
      service_provider: blah
    Stream #0:0[0x13ec]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x13ed](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:2[0x13f0](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:3[0x13ef](eng,eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250
File 'file.hw.mp4' already exists. Overwrite ? [y/N] y
Device creation failed: -542398533.
[mpeg2video @ 0x55dd25718e80] No device available for decoder: device type vaapi needed for codec mpeg2video.
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (mp2 (native) -> aac (native))
Device setup failed for decoder on input stream #0:0 : Generic error in an external library

real    0m2.230s
user    0m0.032s
sys    0m0.014s

# vainfo 
error: can't connect to X server!
error: failed to initialize display


Replies (12)

RE: using GPU transcoder acceleration without having X11 console loaded? - Added by saen acro about 3 years ago

heve you read this in your log

No device available for decoder: device type vaapi needed for codec mpeg2video.

AMD have very bad support for transcoding aka AMF
and your command line do not use correct commands
second:
your FFMpeg do not support it
https://github.com/markus-perl/ffmpeg-build-script
build more good FFMpeg ;)

RE: using GPU transcoder acceleration without having X11 console loaded? - Added by Paul M about 3 years ago

I also tried the commands here:
https://trac.ffmpeg.org/wiki/Hardware/VAAPI

to initialise a device

# ffmpeg -init_hw_device vaapi=amdgpu:/dev/dri/renderD128
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.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 @ 0x56001d9e65c0] No VA display found for device /dev/dri/renderD128.
Device creation failed: -22.
Failed to set value 'vaapi=amdgpu:/dev/dri/renderD128' for option 'init_hw_device': Invalid argument
Error parsing global options: Invalid argument

so I will have a go at building ffmpeg as per your helpful suggestion, thanks

RE: using GPU transcoder acceleration without having X11 console loaded? - Added by saen acro about 3 years ago

ffmpeg -hide_banner -hwaccels

helpful command ;)
ffmpeg -hwaccel auto -i INPUT -c:v h264_amf OUTPUT

RE: using GPU transcoder acceleration without having X11 console loaded? - Added by Paul M about 3 years ago

digging through the build output of ffpmeg

External libraries providing hardware acceleration:
amf                     v4l2_m2m

...snip...

External libraries providing hardware acceleration:
amf                     v4l2_m2m

...snip...

RE: using GPU transcoder acceleration without having X11 console loaded? - Added by Paul M about 3 years ago

I noticed the ffmpeg build created two ffmpeg programs, the large one got copied to the /usr/bin, the other wasn't even executable so I made it executable but it failed like the other, only with even more verbosity

$ find . -iname ffmpeg -ls
  2503946      4 drwxrwxr-x   3 paulm    paulm        4096 Oct 17 11:24 ./workspace/share/ffmpeg
   541931  39088 -rwxr-xr-x   1 paulm    paulm    40023848 Oct 17 11:24 ./workspace/bin/ffmpeg
  2104553  39088 -rwxrwxr-x   1 paulm    paulm    40023848 Oct 17 11:24 ./packages/FFmpeg-release-4.4/ffmpeg
  2492984      4 drwxrwxr-x   3 paulm    paulm        4096 Jul 20 19:56 ./packages/AMF-1.4.21/AMF-v.1.4.21/Thirdparty/ffmpeg
  2492994    260 -rwxrwxr-x   1 paulm    paulm      264320 Jul 20 19:56 ./packages/AMF-1.4.21/AMF-v.1.4.21/Thirdparty/ffmpeg/ffmpeg-4.1.3/lnx64/release/bin/ffmpeg

# /home/paulm/build/ffmpeg-build-script/packages/AMF-1.4.21/AMF-v.1.4.21/Thirdparty/ffmpeg/ffmpeg-4.1.3/lnx64/release/bin/ffmpeg -hide_banner -hwaccels
Hardware acceleration methods:
vdpau
cuda
vaapi
drm
opencl

# /home/paulm/build/ffmpeg-build-script/packages/AMF-1.4.21/AMF-v.1.4.21/Thirdparty/ffmpeg/ffmpeg-4.1.3/lnx64/release/bin/ffmpeg -hwaccel auto -c:v h264_amf  -i Recording.ts Recording.hw.mp4 
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04)
  configuration: --arch=x86_64 --enable-shared --enable-pthreads --enable-avresample --enable-version3 --enable-openssl --disable-debug --extra-cflags='-I/home/rhuts/Desktop/ffmpeg/zlib-1.2.11/bin/lib64,-I/home/rhuts/Desktop/ffmpeg/openssl-1.1.1c/lnx64/include' --extra-ldflags='-Wl,-rpath=$ORIGIN,-L/home/rhuts/Desktop/ffmpeg/zlib-1.2.11/bin/lib64,-L/home/rhuts/Desktop/ffmpeg/openssl-1.1.1c/lnx64/lib' --enable-rpath
  WARNING: library configuration mismatch
  avutil      configuration: --prefix=/usr --extra-version=1ubuntu0.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
  avcodec     configuration: --prefix=/usr --extra-version=1ubuntu0.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
  avformat    configuration: --prefix=/usr --extra-version=1ubuntu0.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
  avdevice    configuration: --prefix=/usr --extra-version=1ubuntu0.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
  avfilter    configuration: --prefix=/usr --extra-version=1ubuntu0.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
  avresample  configuration: --prefix=/usr --extra-version=1ubuntu0.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
  swscale     configuration: --prefix=/usr --extra-version=1ubuntu0.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
  swresample  configuration: --prefix=/usr --extra-version=1ubuntu0.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. 22.100 / 56. 31.100
  libavcodec     58. 35.100 / 58. 54.100
  libavformat    58. 20.100 / 58. 29.100
  libavdevice    58.  5.100 / 58.  8.100
  libavfilter     7. 40.101 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  5.100
  libswresample   3.  3.100 /  3.  5.100
Unknown decoder 'h264_amf'

RE: using GPU transcoder acceleration without having X11 console loaded? - Added by saen acro about 3 years ago

Paul M wrote:

ffmpeg -hwaccel auto -c:v h264_amf -i Recording.ts Recording.hw.mp4

wrong command line

you say
FFmpeg use whatever you found hardware DECODER , convert Video Stream using h264 hardware ENCODER , some file
result error

you must say

FFMpeg open with wathever you found hardware DECODER SOURCE, convert Video Stream using h264 hardware ENCODER , write to file

ffmpeg -hwaccel auto -i INPUT -c:v h264_amf OUTPUT

https://wiki.archlinux.org/title/FFmpeg#AMD_AMF

RE: using GPU transcoder acceleration without having X11 console loaded? - Added by Paul M about 3 years ago

I did try your command line, I can see it in my bash history, but I appreciate I've spammed this thread so here it is below. Why is ffmpeg unable to find libamfrt64.so?

# ffmpeg -hwaccel auto -i Recording.ts -c:v h264_amf Recording.hw.mp4 
ffmpeg version v1.31-2-gce01ac8 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --enable-libdav1d --enable-libsvtav1 --enable-libvpx --enable-libaom --enable-libzimg --enable-lv2 --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libtheora --enable-libwebp --enable-amf --disable-debug --disable-doc --disable-shared --enable-pthreads --enable-static --enable-small --enable-version3 --extra-cflags='-I/home/paulm/build/ffmpeg-build-script/workspace/include -I/home/paulm/build/ffmpeg-build-script/workspace/include/lilv-0' --extra-ldexeflags= --extra-ldflags='-L/home/paulm/build/ffmpeg-build-script/workspace/lib -L/zlib/lib' --extra-libs='-ldl -lpthread -lm -lz' --pkgconfigdir=/home/paulm/build/ffmpeg-build-script/workspace/lib/pkgconfig --pkg-config-flags=--static --prefix=/home/paulm/build/ffmpeg-build-script/workspace --extra-version=
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
[mpeg2video @ 0x560a23aa9c00] Invalid frame dimensions 0x0.
    Last message repeated 22 times
[mpegts @ 0x560a23aa22c0] start time for stream 0 is not set in estimate_timings_from_pts
[mpegts @ 0x560a23aa22c0] PES packet size mismatch
[mpegts @ 0x560a23aa22c0] Packet corrupt (stream = 2, dts = 2902292192).
Input #0, mpegts, from 'Recording.ts':
  Duration: 00:27:52.12, start: 30576.228644, bitrate: 2402 kb/s
  Program 1 
    Metadata:
      service_name    : BBC NEWS
      service_provider: BSkyB
  Stream #0:1[0x13ec]: Video: mpeg2video ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Side data:
      cpb: bitrate max/min/avg: 15000000/0/0 buffer size: 1835008 vbv_delay: N/A
  Stream #0:2[0x13ed](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
  Stream #0:3[0x13f0](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
  Stream #0:4[0x13ef](eng,eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
  No Program
  Stream #0:0[0x12]: Data: epg
File 'Recording.hw.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:1 -> #0:0 (mpeg2video (native) -> h264 (h264_amf))
  Stream #0:2 -> #0:1 (mp2 (native) -> aac (native))
Press [q] to stop, [?] for help
[h264_amf @ 0x560a23ae7c40] DLL libamfrt64.so.1 failed to open
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
[aac @ 0x560a23b85a40] Qavg: 169.983
[aac @ 0x560a23b85a40] 2 frames left in the queue on closing
Conversion failed!

RE: using GPU transcoder acceleration without having X11 console loaded? - Added by Paul M about 3 years ago

I installed the AMD official driver, having downloaded the tarball amdgpu-pro-21.20-1292797-ubuntu-20.04.tar.xz and using their installation instructions.

RE: using GPU transcoder acceleration without having X11 console loaded? - Added by Paul M about 3 years ago

I installed a load of other packages from the downloaded AMD driver pack, and got some libamf files:

# find / -iname "libamfrt64*" 
/opt/amdgpu-pro/lib/x86_64-linux-gnu/libamfrt64.so
/opt/amdgpu-pro/lib/x86_64-linux-gnu/libamfrt64.so.0.0.0
/opt/amdgpu-pro/lib/x86_64-linux-gnu/libamfrt64.so.0

still missing the libamfrt64.so.1 so I hacked in a link from that to libamfrt64.so.0 to see if it would fix things. now I get a totally different error

# ffmpeg -hwaccel auto -i Recording.ts -c:v h264_amf Recording.hw.mp4
ffmpeg version v1.31-2-gce01ac8 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --enable-libdav1d --enable-libsvtav1 --enable-libvpx --enable-libaom --enable-libzimg --enable-lv2 --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libtheora --enable-libwebp --enable-amf --disable-debug --disable-doc --disable-shared --enable-pthreads --enable-static --enable-small --enable-version3 --extra-cflags='-I/home/paulm/build/ffmpeg-build-script/workspace/include -I/home/paulm/build/ffmpeg-build-script/workspace/include/lilv-0' --extra-ldexeflags= --extra-ldflags='-L/home/paulm/build/ffmpeg-build-script/workspace/lib -L/zlib/lib' --extra-libs='-ldl -lpthread -lm -lz' --pkgconfigdir=/home/paulm/build/ffmpeg-build-script/workspace/lib/pkgconfig --pkg-config-flags=--static --prefix=/home/paulm/build/ffmpeg-build-script/workspace --extra-version=
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
[mpeg2video @ 0x5578782cfc00] Invalid frame dimensions 0x0.
    Last message repeated 22 times
[mpegts @ 0x5578782c82c0] start time for stream 0 is not set in estimate_timings_from_pts
[mpegts @ 0x5578782c82c0] PES packet size mismatch
[mpegts @ 0x5578782c82c0] Packet corrupt (stream = 2, dts = 2902292192).
Input #0, mpegts, from 'Recording.ts':
  Duration: 00:27:52.12, start: 30576.228644, bitrate: 2402 kb/s
  Program 1 
    Metadata:
      service_name    : BBC NEWS
      service_provider: BSkyB
  Stream #0:1[0x13ec]: Video: mpeg2video ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Side data:
      cpb: bitrate max/min/avg: 15000000/0/0 buffer size: 1835008 vbv_delay: N/A
  Stream #0:2[0x13ed](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
  Stream #0:3[0x13f0](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
  Stream #0:4[0x13ef](eng,eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
  No Program
  Stream #0:0[0x12]: Data: epg
File 'Recording.hw.mp4' already exists. Overwrite? [y/N] y
Device creation failed: -542398533.
[mpeg2video @ 0x557878401f80] Auto hwaccel disabled: no device found.
Stream mapping:
  Stream #0:1 -> #0:0 (mpeg2video (native) -> h264 (h264_amf))
  Stream #0:2 -> #0:1 (mp2 (native) -> aac (native))
Press [q] to stop, [?] for help
[h264_amf @ 0x557878319200] AMF failed to initialise on the given Vulkan device: 1.
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
[aac @ 0x5578783aba40] Qavg: 169.983
[aac @ 0x5578783aba40] 2 frames left in the queue on closing
Conversion failed!

RE: using GPU transcoder acceleration without having X11 console loaded? - Added by Paul M about 3 years ago

  1. ffmpeg -hide_banner -hwaccels
    Hardware acceleration methods:
    vaapi
    (1-12/12)