[FFmpeg-user] -threads option has no effect

Claudiu Rad-Lohanel jazzman at misalpina.net
Tue Aug 12 13:02:52 CEST 2014

On 8/12/2014 1:56 PM, Rohit Talwar wrote:
> Hi
> Thanks for looking into my query. I have a main java program within which I
> run ffmpeg (using exec). Often there comes a scenario wherein my program
> needs to create 4+ different instances of ffmpeg program for converting
> files into different formats. When this happens the cpu gets 'too busy'
> running the ffmpeg instances which affects the performance of my java
> program.
> I think lowering the priority(using nice or start /LOW )  of the ffmpeg
> process might be a possible strategy to solve this, but would be glad if
> you can help me point towards a platform independent solution.
> On Tue, Aug 12, 2014 at 3:39 PM, James Darnley <james.darnley at gmail.com>
> wrote:
>> On 2014-08-12 11:59, Rohit Talwar wrote:
>>> Hi
>>> I ran the command - ffmpeg -threads <number of threads> -i <my file.avi>
>> Perhaps you should not be using it as an input option.

or to expand this a bit for regular people that don't understand that 
order matters:
try to put threads option AFTER the input file, because most options 
apply to the next input/output file in the command line, like this:

ffmpeg -i <my file.avi> -threads <number of threads> ... <output>

don't know if it would do the job for you but it should.
also, lowering process priority and letting ffmpeg use all available 
resources would be my recommendation for maximum performance in all cases.

>>> <target.mp4> hoping it would not hog my cpu and consume only one core of
>> my
>>> machine. But it was still taking up all of my cpu. I ran the following
>>> experiments to confirm my suspicion that including the -threads option
>> has
>>> no effect on cpu usage.
>> Why do you not want it to use as much CPU as it can?  If this is a
>> desktop that you are using at the same time you should lower the
>> priority of the ffmpeg process.
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user


-------------- next part --------------
A non-text attachment was scrubbed...
Name: jazzman.vcf
Type: text/x-vcard
Size: 263 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140812/65c6882f/attachment.vcf>

More information about the ffmpeg-user mailing list