[FFmpeg-user] ffmpeg multi threading

Lou lou at fakeoutdoorsman.com
Tue Apr 26 20:14:53 CEST 2011


On Tue, 26 Apr 2011 16:52:27 +0200
shacky <shacky83 at gmail.com> wrote:

> Hi.
> I'm using ffmpeg on my Windows machine to convert some videos from TS
> to FLV. I have a quadcore processor and I'm making some benchmark to
> have the conversion process as fast as possible.
> 
> I'm using the binary win32 static version of ffmpeg from
> http://ffmpeg.arrozcru.org/autobuilds/.

Newer Windows builds are located here:
http://hawkeye.arrozcru.org/

> The command I use to convert from TS to FLV is the following:
> 
> C:\Record\tv>c:\utils\ffmpeg-r26400\bin\ffmpeg.exe -i myfile.ts -y -f
> flv -s 320x240 -b 464k -ac 2 -ar 22050 -ab 48k myfile.flv
> 
> But if I try to add the -threads 2 or -threads 4 parameter I get this
> error:
> 
> Error while opening encoder for output stream #0.0 - maybe incorrect
> parameters such as bit_rate, rate, width or height
> 
> so I'm thinking that ffmpeg is not using all available cores of my
> CPU...
> 
> Could you help me please?
> 
> Thank you very much!
> Bye.

flv (the encoder, not the container) does not support multithreaded
encoding.

Use libx264 if you want to output to flv and have multithreaded
encoding. Example:

ffmpeg -i input -vcodec libx264 -preset medium -crf 24 -threads 0 \
-vf scale=320:-1 -acodec libmp3lame -ar 44100 -aq 5 output.flv


More information about the ffmpeg-user mailing list