[FFmpeg-user] AMD GPU + Vaapi encoding problem

Dennis Mungai dmngaie at gmail.com
Thu Apr 9 02:12:15 EEST 2020


On Wed, 8 Apr 2020, 22:58 Colin Bitterfield, <colin at bitterfield.com> wrote:

> I tried VAAPI with a RADEON 580 on Linux. It was intermittent at best.
>
> I wound up using Vulkan with success.
>
> This is the hwaccel command I was using for transcoding.
>
> time ffmpeg -hide_banner -stats -hwaccel vulkan -init_hw_device vulkan:0
> -threads 16 -i input.mp4 -vf scale=854:480 -c:v  libopenh264  -c:a copy
> -quality quality -b:v 2M -crf 23 -maxrate 2M -bufsize 6M -slice_mode dyn
> -max_nal_size 65535 -allow_skip_frames 1 output_gpu_3.mp4 -y
>
> I started writing an article on RADEON based transcoding:
> Here is a draft link. It is far from done. But I will finishing it this
> week
>
> https://medium.com/@cbitterfield/radeon-gpu-transcoding-with-ubuntu-18-04-lts-2e5143d0d1cd
> On Apr 8, 2020, 12:39 PM -0700, Tobias Kilb <tobiaskilb at gmail.com>, wrote:
> > Uh, indeed. Good to know. I thought the development is going towards
> vaapi
> > from amd/intel.
> >
> > Regards
> > Tobias
> >
> > Ostap Batug <ostik0bleat at gmail.com> schrieb am Mi., 8. Apr. 2020, 21:25:
> >
> > >
> https://wiki.archlinux.org/index.php/Hardware_video_acceleration#ATI/AMD
> > >
> > > On Wed, 8 Apr 2020 at 22:17, Tobias Kilb <tobiaskilb at gmail.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > AI am wondering why it shows vdpau because you have an amd graphics
> > > > adapter.
> > > >
> > > > Regards
> > > > Tobias
> > > >
> > > > Ostap Batug <ostik0bleat at gmail.com> schrieb am Mi., 8. Apr. 2020,
> 21:08:
> > > >
> > > > > Hello,
> > > > > Yes this is the same machine
> > > > > i havent figured out a command to run with -init_hw_device , but
> > > > -hwaccels
> > > > > reports:
> > > > > Hardware acceleration methods:
> > > > > vdpau
> > > > > so seems that i don't have vaapi? although i am not certain, yes
> my gpu
> > > > is
> > > > > primarily supporting vdpau, but i have a sort of vaapi emulation
> with
> > > > > vdpau, or something?
> > > > > Regards,
> > > > > Repu
> > > > >
> > > > > On Wed, 8 Apr 2020 at 21:03, Ted Park <kumowoon1025 at gmail.com>
> wrote:
> > > > >
> > > > > > Hello,
> > > > > >
> > > > > > > Okay, i've used latest static build from git of amd64 arch, it
> > > can't
> > > > > find
> > > > > > > option -vaapi_device,
> > > > > > > and this is the output (ran from the extracted archive path):
> > > > > > > $ ./ffmpeg -vaapi_device /dev/dri/renderD128 -f x11grab
> -video_size
> > > > > > > 1920x1080 -i :0 -vf 'format=nv12,hwupload' -c:v h264_vaapi
> -b:v 7M
> > > > > > > -profile:v main -bf 0 output.mp4
> > > > > > > ffmpeg version N-52056-ge5d25d1147-static
> > > > > > https://johnvansickle.com/ffmpeg/
> > > > > > > Copyright (c) 2000-2020 the FFmpeg developers
> > > > > > > built with gcc 8 (Debian 8.3.0-6)
> > > > > > > configuration: --enable-gpl --enable-version3 --enable-static
> > > > > > > --disable-debug --disable-ffplay --disable-indev=sndio
> > > > > > > --disable-outdev=sndio --cc=gcc --enable-fontconfig
> --enable-frei0r
> > > > > > > --enable-gnutls --enable-gmp --enable-libgme --enable-gray
> > > > > > --enable-libaom
> > > > > > > --enable-libfribidi --enable-libass --enable-libvmaf
> > > > > --enable-libfreetype
> > > > > > > --enable-libmp3lame --enable-libopencore-amrnb
> > > > > --enable-libopencore-amrwb
> > > > > > > --enable-libopenjpeg --enable-librubberband --enable-libsoxr
> > > > > > > --enable-libspeex --enable-libsrt --enable-libvorbis
> > > --enable-libopus
> > > > > > > --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc
> > > > > > > --enable-libvpx --enable-libwebp --enable-libx264
> --enable-libx265
> > > > > > > --enable-libxml2 --enable-libdav1d --enable-libxvid
> > > --enable-libzvbi
> > > > > > > --enable-libzimg
> > > > > > > libavutil 56. 42.101 / 56. 42.101
> > > > > > > libavcodec 58. 76.100 / 58. 76.100
> > > > > > > libavformat 58. 42.100 / 58. 42.100
> > > > > > > libavdevice 58. 9.103 / 58. 9.103
> > > > > > > libavfilter 7. 77.100 / 7. 77.100
> > > > > > > libswscale 5. 6.101 / 5. 6.101
> > > > > > > libswresample 3. 6.100 / 3. 6.100
> > > > > > > libpostproc 55. 6.100 / 55. 6.100
> > > > > > > Unrecognized option 'vaapi_device'.
> > > > > > > Error splitting the argument list: Option not found
> > > > > >
> > > > > >
> > > > > > The option might not be there any more, try using -init_hw_device
> > > > > instead,
> > > > > > and use -hwaccels to list additional hardware support?
> > > > > > Also confirm this is the same machine (or at least with similar
> > > > hardware)
> > > > > > that ran the earlier command?
> > > > > >
> > > > > > Regards,
> > > > > > Ted Park
> > > > > >
> > > > > > _______________________________________________
> > > > > > ffmpeg-user mailing list
> > > > > > ffmpeg-user at ffmpeg.org
> > > > > > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > > > > >
> > > > > > To unsubscribe, visit link above, or email
> > > > > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > > > > _______________________________________________
> > > > > ffmpeg-user mailing list
> > > > > ffmpeg-user at ffmpeg.org
> > > > > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > > > >
> > > > > To unsubscribe, visit link above, or email
> > > > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > > > _______________________________________________
> > > > ffmpeg-user mailing list
> > > > ffmpeg-user at ffmpeg.org
> > > > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > > >
> > > > To unsubscribe, visit link above, or email
> > > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > > _______________________________________________
> > > ffmpeg-user mailing list
> > > ffmpeg-user at ffmpeg.org
> > > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > >
> > > To unsubscribe, visit link above, or email
> > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > _______________________________________________
> > ffmpeg-user mailing list
> > ffmpeg-user at ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".




That encoder you're using runs on the CPU.

The Vulkan hwcontext is used to initialize the AMD AMF encoders (h264_amf
and hevc_amf) and the Vulkan based filters, ie scale_vulkan,
overlay_vulkan, etc, none of which are in use on your samples.

What you're using is Cisco's openh264 encoder wrapper, and it does not run
on the GPU.


More information about the ffmpeg-user mailing list