[FFmpeg-user] How can I reduce the cpu usage of ffmpeg?

Nicholas Robbins nickrobbins at yahoo.com
Sun Jan 11 14:40:06 CET 2015


> On Sunday, January 11, 2015 6:26 AM, Moritz Barsnick <barsnick at gmx.net> wrote:

> > On Sun, Jan 11, 2015 at 02:07:57 +0100, voip at gmx.ca wrote:
> 
>>  I liked your idea also but it didn't make quite as much sense to me
>>  as the first solution. My problem is the use of the & character
>>  separating the ffmpeg command from the other stuff. I always THOUGHT
>>  that a single & causes a task to run in the background, and while
> 
>>  that's fine for cpulimit, it's not fine for ffmpeg because as I
>>  mentioned there are a couple other cleanup tasks that need to run
>>  after ffmpeg is finished, and if ffmpeg goes into the background,
>>  those tasks will run immediately.
> 
> Fair enough - whatever suits you best. I like that first suggested
> solution as well. Bourne shells do support the "wait" command to wait
> for all background commands to return.
> 
>>  I'm a little confused as to why in the first example the sleep
>>  command is followed by a ; while in yours it's followed by && - 
> two
>>  different ways to indicate the same thing?
> 
> No. One '&' followed by a second command launches the second command
> once the first one has dropped to the background.
> 
> Two '&&' lauches the second command only when the first one 
> terminates
> and returns with "success" (exit code 0). 'sleep & 
> command' makes no
> sense to me.
> 
> 
> Moritz


&& launches the second command if the first one succeeds. 

|| launches the second command if the first one fails.

; launches the second command after the first one finishes.

Nick


More information about the ffmpeg-user mailing list