[FFmpeg-user] Where to place '-shortest' when saving streams to separate files?

Jeff darkmoon at verizon.net
Tue Jul 1 20:37:18 CEST 2014


Hi,

I use Zeranoe's FFMPEG builds with Nero's AAC encoder this way:

$ ffmpeg -y -i InputFile -map 0:0 -vf "some,filters" -c:v libx264 \
-crf xx -preset veryslow temp.m4v -map 0:1 -af "aresample=async=1" \
-f wav - | neroaacenc -q 0.xx -ignorelength -if - -of temp.m4a

$ ffmpeg -y -i temp.m4v -i temp.m4a -map_chapters -1 -shortest \
-movflags faststart -c copy OutputFile.mp4

The results are almost always in sync, but I suspect that '-shortest' 
would be better (read: more accurate) if placed in the first command 
line where the transcoding is taking place, rather than in the second 
where the streams are muxed into the final A/V file. But...how to write 
the first command line so that '-shortest' stops the transcoding of both 
streams when the end of the shorter one is reached? Maybe, different 
command line(s) altogether?

Thanks,

Jeff


More information about the ffmpeg-user mailing list