Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFMPEG with hardware codec support

I have built a simple media player using ffmpeg on Android 2.2. Hardware is an arm cortex-a8 based 1GHz processor, 512 MB RAM. I am getting low performance, around 15 FPS for 800x600 mp4 video. I have a couple of questions on how I can improve the performance

  • How can I use the hardware codecs available on my target device. How can I configure ffmpeg to use the available hardware decoders? Does the GPU or graphics driver have to expose some standard API like OpenMax IL in order to this?

  • What are the options that should be enabled when building ffmpeg so that it can be optimized for my target hardware? Something like: --cpu=cortex=a8 --extra-cflags="-mfpu=neon" ...

I have already looked around the net but I couldn't find the answers that I am looking for. I hope someone can advice me on this.

Thanks in advance!

like image 758
mctma Avatar asked Aug 30 '11 01:08

mctma


People also ask

Does FFmpeg support hardware acceleration?

FFmpeg uses Video Codec SDKFFmpeg supports following functionality accelerated by video hardware on NVIDIA GPUs: Hardware-accelerated encoding of H. 264 and HEVC* Hardware-accelerated decoding of H.

What codecs does FFmpeg support?

The two video codecs are the lossless FFV1, and the lossless and lossy Snow codec.

How do I specify codec in FFmpeg?

You can select the codecs needed by using the -c flag. This will make a Matroska container with a VP9 video stream and a Vorbis audio stream, essentially the same as the WebM we made earlier. The command ffmpeg -codecs will print every codec FFmpeg knows about.


1 Answers

There must be specific code in libav/ffmpeg tailored to your hardware. Right now I can see support for some HW decoders and for hardware that have drivers that expose VPAPI or VDPAU (mostly NVidia) APIs.

Your hardware does not seem supported in a native way by the stock libavcodec drivers. You can get accelerated decoding if you can get hold of either source patches to libavcodec or drivers that expose one of the supported decoding acceleration APIs.

In other words, you should ask your HW provider.

like image 192
gioele Avatar answered Sep 21 '22 01:09

gioele