1

Why in ffmpeg do I have VAAPI encoders but no VAAPI decoders? I have used VAAPI encoders successfully, but would like to use VAAPI for decoding as well (specifically, mpeg2_vaapi decoding). I build my own ffmpeg from git master branch, so am I missing configure options or libraries for decoding?

$ ffmpeg -version
ffmpeg version N-91119-g2940af9389 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration: --prefix=/usr/local --enable-shared --enable-pic --enable-rpath --extra-ldflags='-Wl,-rpath,/usr/local/lib' --enable-libx264 --enable-libx265 --enable-libxvid --enable-libvorbis --enable-nonfree --enable-gpl --enable-zlib --enable-libmp3lame --enable-libfdk-aac --enable-libv4l2 --enable-libbluray --enable-libvpx --enable-libwebp --enable-libmfx --enable-vaapi --enable-vdpau --enable-opencl
libavutil      56. 18.102 / 56. 18.102
libavcodec     58. 19.102 / 58. 19.102
libavformat    58. 14.100 / 58. 14.100
libavdevice    58.  4.100 / 58.  4.100
libavfilter     7. 24.100 /  7. 24.100
libswscale      5.  2.100 /  5.  2.100
libswresample   3.  2.100 /  3.  2.100
libpostproc    55.  2.100 / 55.  2.100
$

$ ffmpeg -encoders 2>&1|grep _vaapi
 V..... h264_vaapi           H.264/AVC (VAAPI) (codec h264)
 V..... hevc_vaapi           H.265/HEVC (VAAPI) (codec hevc)
 V..... mjpeg_vaapi          MJPEG (VAAPI) (codec mjpeg)
 V..... mpeg2_vaapi          MPEG-2 (VAAPI) (codec mpeg2video)
 V..... vp8_vaapi            VP8 (VAAPI) (codec vp8)
 V..... vp9_vaapi            VP9 (VAAPI) (codec vp9)
$

$ ffmpeg -decoders 2>&1|grep _vaapi
$ 
  • 1
    Don't have access to a linux box now, but it should be ffmpeg -hwaccel vaapi -i file ... – Gyan May 22 '18 at 15:05
  • This is what I am using, but Is there a way to verify the decoder is actually using VAAPI? There is no indication of it in the ffmpeg output (that I've spotted). And when I also use VAAPI encoding, Linux is reporting 50% CPU usage on the ffmpeg process (although this is down from 200% when using non-VAAPI encoding). So what I'm saying is I'm confident the encoder is working, but I see no indication the decoder is using VAAPI. – acker9 May 22 '18 at 17:09
  • See the stream mapping lines – Gyan May 22 '18 at 17:10
  • Ok. This is what I see: Stream #0:0 -> #0:0 (mpeg2video (native) -> mpeg2video (mpeg2_vaapi)). mpeg2video (native) leads me to believe it's not using VAAPI for decoding. Command line is ffmpeg -hwaccel_device /dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -i video.ts -an -c:v mpeg2_vaapi -f null /dev/null. – acker9 May 22 '18 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.