[FFmpeg-user] Simultaneous two-pass?

Jesse Gordon tojesseg at gmail.com
Thu Sep 27 21:23:43 CEST 2012


On 09/27/2012 11:26 AM, Carl Eugen Hoyos wrote:
> Jesse Gordon <tojesseg <at> gmail.com> writes:
>
>> Than you very much for the reply. It looks like the
>> decoding part is using 60% of one CPU - so it would
>> be good if there was a way I could decode only once
>> and then re-encode to all the needed resolutions
>> from that.
>>
>> But how would I do that?
> $ ffmpeg -i input -s qcif outqcif.flv -s cif outcif.flv -s vga outvga.flv
>
> Carl Eugen

OK I tried that, and it does simultaneously write to all 3 streams, but 
it pegs one CPU only and won't share the load to different CPUs.

I tried putting a -threads 8 before each -s, and I also tried putting 
-threads 8 at the beginning, and I also tried putting -threads:1 8 
-threads:2 8 etc., at the beginning -- all to no avail.

And doing just:
qcif by itself takes 4.8 seconds, and
cif by itself takes 8.6 seconds, and
vga by itself takes 19.8 seconds.
(The total time for doing each of the three individually is 33.2 seconds.)

And doing all three at once takes 29.8 seconds.

So yes, doing multiple simultaneous output streams does save on decoding 
time, but it's not utilizing more that one CPU.
(For this test, my source file was very small resolution so decoding it 
was almost free.)

How would I make those 3 encoding streams run as 3 different threads?

Thanks very much,

Jesse

>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>



More information about the ffmpeg-user mailing list