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

Moritz Barsnick barsnick at gmx.net
Sun Jan 11 12:26:14 CET 2015


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


More information about the ffmpeg-user mailing list