I have video sharing site and convert video with ffmpeg but it take a lot of time for converting. how can do it fast and safe? I think when ffmpeg match with GPU it helps me but I find no good reference to use. Which application or reference can help me that have good performance.
-
What have you tried? You will have more chance at getting help if you provide the code you have tried. – Aug 17 '13 at 07:34
-
I never heard about a GPU optimized codec in ffmpeg .... In my mind there is no --enable option with./configure to support cusa, opencl, or others. Sorry! – alexbuisson Aug 17 '13 at 07:41
-
h264 converting format use VDPAU acceleration but I don`t know how can enable it and use. – sdnaghdi Aug 17 '13 at 07:42
-
VDPAU (Video Decode and Presentation API for Unix) Not sure it will be useful for the encoding ... Look more like something to decode&play video! – alexbuisson Aug 17 '13 at 13:07
-
Current state https://trac.ffmpeg.org/wiki/HWAccelIntro#CUDACUVIDNvDecode – fubo Jun 26 '17 at 10:05
3 Answers
Update Q4 2017. Since my original answer GPU-based encoding has become widely available. If you have a modern NVIDIA video card and can compile ffmpeg then you should be good to go. Thanks to Dmytro Dzyubak for pointing out the FFmpeg docs stating that indeed "CPU based encoding generally produces better quality than GPU based encoding."
--
GPU based encoding is specific to a codec/GPU computing standard (CUDA, OpenCL) so you would need to specify what are you using in your case. ffmpeg is amongst other things a wrapper for popular codecs like x264 and VP8 for video.
Using x264 all attempts so far have produced mixed results at best. Nothing that could be passed on to production has come to see the light of day.
Main concept offers an SDK that can be used for H264 GPU based encoding. You can read here for more information. I have not seen the price tag for their SDK but it could be expensive I guess.
Depending on the codec you use you are better off tweaking the encoding settings to trade off quality for speed. On a side note CPU based encoding tends to produce better quality than GPU based encoding.

- 6,674
- 5
- 31
- 43
-
31"CPU based encoding produces better quality than GPU based encoding." - citation needed. – Jules G.M. Jun 20 '16 at 23:26
-
4"Hardware encoders typically generate output of significantly lower quality than good software encoders like x264" - https://trac.ffmpeg.org/wiki/HWAccelIntro – Dmytro Dzyubak Nov 21 '17 at 13:07
It may be still "under development", but i found several doom9 thread taking about a huge improvement of the x264 encoder(the lib ffmpeg use) when the "LookAhead" function is "on GPU" But it use OpenCL.
It may help.

- 7,699
- 3
- 31
- 44