[FFmpeg-devel] mediacodec and qsv not really hwaccels ?
Anton Khirnov
anton at khirnov.net
Tue Sep 24 12:50:04 EEST 2024
To elaborate on this, there are two distinct types of hardware decoding
support in libavcodec - hwaccels and hardware decoders.
Hwaccels are integrated into the corresponding native libavcodec
decoder; the decoder does all the high-level header parsing and then
hands off parsed headers and remaining coded data to the API in question
for actually reconstructing the frames.
Hardware decoders are separate decoders that pass the whole bytestream to
the API and receive decoded frames from it.
Whether a given API is wrapped as a hwaccel or a hardware decoder
depends on its design - DXVA/D3D*/VAAPI/VDPAU/NVDEC depend on their
caller (i.e. libavcodec) doing the parsing and thus are hwaccels. QSV
and Mediacodec do their parsing internally and so have to be hardware
decoders.
Generally hwaccel-style APIs are preferred, because
* the same high-level code is run independently of the API vendor, so
things like metadata propagation or various broken-stream workarounds
work consistently everywhere;
* you can switch at runtime between software and hardware decoding;
but we have little control over how vendors choose to implement their
APIs.
--
Anton Khirnov
More information about the ffmpeg-devel
mailing list