[FFmpeg-user] Understanding two pass encoding

Robin Lery robinlery at gmail.com
Sun Aug 9 18:44:26 CEST 2015


Yes, I ended up calling ffmpeg twice with same input with multiple output:

ffmpeg -i input.mp4 \
    -codec:v libx264 -tune zerolatency -profile:v main -preset faster -b:v
1000k -maxrate 1000k -bufsize 10000k -s hd720 -threads 0 -pix_fmt yuv420p
-pass 1 -passlogfile unique_id-hd720 -an -f mp4 -y /dev/null \
    -codec:v libx264 -tune zerolatency -profile:v baseline -level 3.0
-preset faster -b:v 250k -maxrate 250k -bufsize 2500k -vf
scale="trunc(oh*a/2)*2:360" -threads 0 -pix_fmt yuv420p -pass 1
-passlogfile unique_id-360 -an -f mp4 -y /dev/null  && \
ffmpeg -i input.mp4 \
    -codec:v libx264 -tune zerolatency -profile:v main -preset faster -b:v
1000k -maxrate 1000k -bufsize 10000k -s hd720 -threads 0 -pix_fmt yuv420p
-pass 2 -passlogfile unique_id-hd720 -codec:a libfdk_aac -movflags
+faststart output/720.mp4 \
    -codec:v libx264 -tune zerolatency -profile:v baseline -level 3.0
-preset faster -b:v 250k -maxrate 250k -bufsize 2500k -vf
scale="trunc(oh*a/2)*2:360" -threads 0 -pass 2 -passlogfile unique_id-360
-codec:a libfdk_aac -pix_fmt yuv420p -movflags +faststart output/360.mp4


Thank you so much for your help and guidance.

On Sun, Aug 9, 2015 at 4:16 AM, Moritz Barsnick <barsnick at gmx.net> wrote:

> On Sat, Aug 08, 2015 at 18:24:26 +0200, Henk D. Schoneveld wrote:
> > former mail talks about
> > /dev/nul
> > NOT
> > /dev/null
>
> I can't find that mail?
>
> Anyway, he meant that the non-/dev/null ("pass 2") output files are
> empty.
>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list