[FFmpeg-devel] mediacodec and qsv not really hwaccels ?
Xiang, Haihao
haihao.xiang at intel.com
Tue Sep 24 04:15:49 EEST 2024
On Di, 2024-09-24 at 00:53 +0300, Andrew Randrianasulu wrote:
> I tried to trivially add qsv/mediacodec decode to cinelerra-gg, but
> discovered that I can't use it like vaapi/vdpau/cuda because (?)
> qsv/mediacodec not listed in
>
> ffmpeg/libavcodec/hwconfig.h
> and (for h264) in
> ffmpeg/libavcodec/h264dec.c
>
> so on decoding I get (in termux, cingg compiled with system ffmpeg)
>
>
> Decoder h264 does not support device type mediacodec.
>
> HW device init failed, using SW decode.
> file:/data/data/com.termux/files/home/20210419_055507A.mp4
> err: Operation not permitted
>
> yet ffmpeg -hwaccel show
>
> ~/cinelerra/cinelerra-5.1 $ ffmpeg -hwaccels
>
> ffmpeg version 6.1.2 Copyright (c) 2000-2024 the FFmpeg developers
>
> built with Android (12027248, +pgo, +bolt, +lto, +mlgo, based on r522817)
> clang version 18.0.1 (
> https://android.googlesource.com/toolchain/llvm-project
> d8003a456d14a3deb8054cdaa529ffbf02d9b262) configuration: --arch=aarch64
> --as=aarch64-linux-android-clang --cc=aarch64-linux-android-clang
> --cxx=aarch64-linux-android-clang++ --nm=llvm-nm
> --pkg-config=/home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/pkg-
> config
> --strip=llvm-strip --cross-prefix=aarch64-linux-android- --disable-indevs
> --disable-outdevs --enable-indev=lavfi --disable-static --disable-symver
> --enable-cross-compile --enable-gnutls --enable-gpl --enable-version3
> --enable-jni --enable-lcms2 --enable-libaom --enable-libass
> --enable-libbluray --enable-libdav1d --enable-libfontconfig
> --enable-libfreetype --enable-libfribidi --enable-libgme
> --enable-libharfbuzz --enable-libmp3lame --enable-libopencore-amrnb
> --enable-libopencore-amrwb --enable-libopenmpt --enable-libopus
> --enable-librav1e --enable-libsoxr --enable-libsrt --enable-libssh
> --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab
> --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
> --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2
> --enable-libxvid --enable-libzimg --enable-mediacodec --enable-opencl
> --enable-shared --prefix=/data/data/com.termux/files/usr
> --target-os=android --extra-libs=-landroid-glob --disable-vulkan
> --enable-neon --disable-libfdk-aac libavutil 58.
> 29.100 / 58. 29.100
>
> libavcodec 60. 31.102 / 60. 31.102
>
> libavformat 60. 16.100 / 60. 16.100
>
> libavdevice 60. 3.100 / 60. 3.100
>
> libavfilter 9. 12.100 / 9. 12.100
>
> libswscale 7. 5.100 / 7. 5.100
>
> libswresample 4. 12.100 / 4. 12.100
>
> libpostproc 57. 3.100 / 57. 3.100
>
> Hardware acceleration methods:
> opencl
> mediacodec
>
> ===
>
> is it oversight or some more fundamental limitation?
vaapi/cuda/vdpau is used to accelerate the native decoders in FFmpeg, however
for mediacodec/qsv, there are corresponding decoders.
For example, both qsv and vaapi are enabled when running configuration, you may
get all supported qsv decoders with the command below:
$ ffmpeg -decoders 2>/dev/null | grep qsv
V....D av1_qsv AV1 video (Intel Quick Sync Video acceleration) (codec av1)
V....D h264_qsv H264 video (Intel Quick Sync Video acceleration) (codec h264)
V....D hevc_qsv HEVC video (Intel Quick Sync Video acceleration) (codec hevc)
V....D mjpeg_qsv MJPEG video (Intel Quick Sync Video acceleration) (codec mjpeg)
V....D mpeg2_qsv MPEG2VIDEO video (Intel Quick Sync Video acceleration) (codec mpeg2video)
V....D vc1_qsv VC1 video (Intel Quick Sync Video acceleration) (codec vc1)
V....D vp8_qsv VP8 video (Intel Quick Sync Video acceleration) (codec vp8)
V....D vp9_qsv VP9 video (Intel Quick Sync Video acceleration) (codec vp9)
However for vaapi, you will get nothing,
$ ffmpeg -decoders 2>/dev/null | grep vaapi
Thanks
Haihao
More information about the ffmpeg-devel
mailing list