Hello Community members, Quoting from the ffmpeg's wiki for creating multiple outputs. https://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs *Parallel encoding*: Outputting and re encoding multiple times in the same FFmpeg process will typically slow down to the "slowest encoder" in your list. Some encoders (like libx264) perform their encoding "threaded and in the background" so they will effectively allow for parallel encodings.
Unfortunately, my results are not correlating with what is mentioned above. By that I mean, I am not seeing encoding being performed in parallel on multiple outputs even when using libx264. To simplify the problem and to understand it easily, here's what I am doing for strictly benchmarking purposes. Option1: Run 3 instances of ffmpeg using pipe. ffmpeg -i input.mp4 -c:v libx264 -b:v 12M -f null - | ffmpeg -i input.mp4 -c:v libx264 -b:v 12M -f null - | ffmpeg -i input.mp4 -c:v libx264 -b:v 12M -f null - Option2: run all three encodes in single ffmpeg process ffmpeg -i input.mp4 -c:v libx264 -b:v 12M -f null - -c:v libx264 -b:v 12M -f null - -c:v libx264 -b:v 12M -f null - I am executing this workload on 32 core platform on google cloud. Option1 gives me nearly 100% cpu utilization. In case of Option 2 cpu utilization doesn't go beyond 50% and also fps is about 70% of the option1. Then why don't I just use Option1? Because Option2 decodes the input only once. I need to generate many streams (up to 25 streams) from the same input file which could be 4K or even bigger. So I want to avoid the overhead of decoding the same input so many times in Option1. So basically, I want to make Option2 work but I am not understanding why it's not running all the encodes in parallel to give me better fps and maximum cpu utilization. After taking a quick look at the code, it doesn't seem like ffmpeg is creating multiple threads to run multiple x264 encode sessions in parallel. I know x264 library itself will create multiple threads but that's for a single output. What I am looking for is output level parallelism. Can some one explain if this is possible? Or may be, I can use some different kind of command line to achieve such output level parallelism? Shalin _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".