[FFmpeg-user] Using FFMPEG to encode multiple outputs in 'parallel' (doesn't work?)

shalin shalin186 at gmail.com
Thu Jul 6 00:23:39 EEST 2017


Reuben Martin wrote
> On Thursday, June 29, 2017 6:56:51 PM CDT shalin wrote:
>> Cley Faye wrote
>> 
>> > More to the point, as far as I know, ffmpeg will not do parallel
>> treatment
>> > on either input or output, as you deduced. It certainly is doable, but
>> > don't seem trivial to implement in the ffmpeg CLI tool itself since
>> that
>> > tool must handle various cases, and introducing (more) special cases
>> would
>> > add complexity for not much benefits.
>> > 
>> > You should look in using the various ffmpeg libraries directly; with
>> that
>> > you could probably write it to decode once, encode multiple time. But
>> > unless you have shockingly similar settings and unlimited processing
>> > power,
>> > you'll most likely stall some of your encodings while other catch up
>> with
>> > them. I don't know how well ffmpeg libraries handle multithreading (I
>> > suppose fairly well since most of it's operations are based on context
>> > structures) but you'll have to do a fair amount of synchronization by
>> > hand.
>> 
>> Thank you for your answer to my original question. So from this, I am
>> assuming that ffmpeg in its current form doesn't support output level
>> parallelism. Actually I have 'shockingly' similar transcodings to perform
>> on
>> a given input stream (I need to crop different parts of the input video
>> and
>> encode them at same bitrate and also cropped parts are same in size for
>> each stream). With that each encode should roughly run at the same rate
>> and
>> I believe multithreading should be really helpful.
> 
> All this is possible but you need to do a lot of reading. Starting with
> input 
> mapping. http://www.ffmpeg.org/ffmpeg-all.html#Advanced-options
> 
> It couldn’t hurt to read up on how anonymous pipes work in a posix shell,
> as 
> well as other shell related concepts.

There's no doubt that I need a lot of reading but I wish you at least read
my question properly. It has nothing to do with pipes or shell. It's about
running multiple encodes in parallel within single ffmpeg process (option 2
in my question). Simply providing the link doesn't help as it doesn't solve
the issue at hand.




--
View this message in context: http://www.ffmpeg-archive.org/Using-FFMPEG-to-encode-multiple-outputs-in-parallel-doesn-t-work-tp4680420p4680482.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.


More information about the ffmpeg-user mailing list