[Libav-user] Transcoding: specify and hardware acceleration for the decoding

Menion menion at gmail.com
Tue Jan 3 18:21:45 EET 2017

Hi all
I have recently joined the effort to bring a good hardware acceleration for
transcoding to TVHeadend on Raspberry PI hardware.
TVHeadend use libavcodec as transcoding subsystem
With the recent OMX IL support for encoding, we got some progress, but
still the CPU is overkilled during the process. Rpi works ok with command
line transconding using ffmpeg utils
I have looked at the code and I thing that the problem is with the pickup
of the decoder
First of all: I know that MPEG2 HW decoder need the license, but I want to
focus more on the AVCodec * pickup
The transcoding engine setup the decoder and the encoder based on

1) For the decoder: there is a helper function that check the input video
format and pickup the best decoder using the libavcodec function:

AVCodec* avcodec_find_decoder(enum AVCodecID id)

2) For the encoder, the user provides a plain text video codec string that
is passed to the function:

AVCodec * avcodec_find_encoder_by_name (const char *name)

the encoder part is ok, but the decoding part puzzle me. The enum AVCodecID
doesn't list any codec that explicitly point to some hw acceleration. So I
suspect that the decoding is done just in software, causing CPU overkill.
Is my assumption correct? How is possible to specify an hardware
acceleration? Or is the case that, when the application wants to use
hardware acceleration for decoding, shall use instead the function:

AVCodec * avcodec_find_decoder_by_name (const char *name)

passing the correct decoder name, that on raspberry pi shall be mpeg2_mmal
or h264_mmal according to the source?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20170103/1f5cee16/attachment.html>

More information about the Libav-user mailing list