[FFmpeg-user] Reusing ffmpeg2pass-0.log

c2e6bdae at fastmail.com c2e6bdae at fastmail.com
Fri Jan 14 04:19:05 EET 2022


Hello,

I need to split input.mp4 into multiple webm files of a certain size. At the moment, I'm running the following commands (assuming only two output files, although they can be more):

# 1st file
ffmpeg -i input.mp4 -threads 3 -c:a libvorbis -b:a 128K -c:v libvpx -quality best -vf scale=-2:480 -ss 0 -fs 200k -b:v 500k -pass 1 -an -y -f null /dev/null
ffmpeg -i input.mp4 -threads 3 -c:a libvorbis -b:a 128K -c:v libvpx -quality best -vf scale=-2:480 -ss 0 -fs 200k -b:v 500k -pass 2 part1.webm
# 2nd file
ffmpeg -i input.mp4 -threads 3 -c:a libvorbis -b:a 128K -c:v libvpx -quality best -vf scale=-2:480 -ss 5 -fs 200k -b:v 500k -pass 1 -an -y -f null /dev/null
ffmpeg -i input.mp4 -threads 3 -c:a libvorbis -b:a 128K -c:v libvpx -quality best -vf scale=-2:480 -ss 5 -fs 200k -b:v 500k -pass 2 part2.webm

In such scenario, could I simply reuse ffmpeg2pass-0.log generated in the first ffmpeg invocation for all subsequent 2nd passes? E.g.:

# 1st file, generate ffmpeg2pass-0.log
ffmpeg -i input.mp4 -threads 3 -c:a libvorbis -b:a 128K -c:v libvpx -quality best -vf scale=-2:480 -ss 0 -fs 200k -b:v 500k -pass 1 -an -y -f null /dev/null
ffmpeg -i input.mp4 -threads 3 -c:a libvorbis -b:a 128K -c:v libvpx -quality best -vf scale=-2:480 -ss 0 -fs 200k -b:v 500k -pass 2 part1.webm
# 2nd file, reuse ffmpeg2pass-0.log
ffmpeg -i input.mp4 -threads 3 -c:a libvorbis -b:a 128K -c:v libvpx -quality best -vf scale=-2:480 -ss 5 -fs 200k -b:v 500k -pass 2 part2.webm
# 3rd file, reuse ffmpeg2pass-0.log
ffmpeg -i input.mp4 -threads 3 -c:a libvorbis -b:a 128K -c:v libvpx -quality best -vf scale=-2:480 -ss 10 -fs 200k -b:v 500k -pass 2 part2.webm
# ...And so on

Thanks.


More information about the ffmpeg-user mailing list