I was wondering if ffmpeg supported gpu acceleration. I was reading on their websites and came across contradicting information.

http://www.ffmpeg.org/general.html#Video-Codecs -H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)

http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide -Will a graphics card make x264 encode faster? No. libx264 doesn't use them (at least not yet). There are some proprietary encoders that utilize the GPU, but that does not mean they are well optimized, though encoding time may be faster; and they might be worse than x264 anyway, and possibly slower. Regardless, FFmpeg today doesn't support any means of gpu encoding, outside of libx264.

If not, is there any way to add gpu acceleration to h.264 encoding/decoding?


VDPAU only accelerates the decoding/playing of video. I don't know if the time taken to copy the raw video to the GPU encode, and then read back the compressed data would really mean there was much benefit from a GPU.

With playback you are forced to copy the data to the GPU anyway and it's obvisuly better to copy the smaller compressed source stream.

There is an example of doing the H264 compression step in the NVidia CUDA SDK but you need to provide other code to make an actual video


You could try this: https://developer.nvidia.com/nvidia-video-codec-sdk for encoding the h264 streams then mux them with ffmpeg.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.