I have an input file that I am encoding with multiple output resolutions. I want to use the exact same audio encoding parameters for each output video file (-c:a aac -b:a 64k -ac 1
). For a performance boost, is there a way to not have to encode the same audio three different times?
I know I could encode audio separately and mux it later, but could the audio only be encoded once and applied to all the output files all in a single command?
I've done plenty of searching around, but can't find an answer.
Here's my encode string:
ffmpeg -i in.flv -r 30 -filter_complex "[0:v]hqdn3d=0:0:6:6,setpts=PTS-STARTPTS[dn]; [dn]split=3[dn1][dn2][dn3];
[dn1]copy[v1out]; [dn2]scale=w=854:h=480[v2out]; [dn3]scale=w=640:h=360[v3out]"
-map [v1out] -c:v:0 libx264 -x264-params "keyint=150:min-keyint=150" -preset slow -crf 26 -map 0:a:0 -c:a:0 aac -b:a:0 64k -ac 1 -f mp4 out.720.mp4
-map [v2out] -c:v:1 libx264 -x264-params "keyint=150:min-keyint=150" -preset slow -crf 26 -map 0:a:0 -c:a:1 aac -b:a:1 64k -ac 1 -f mp4 out.480.mp4
-map [v3out] -c:v:2 libx264 -x264-params "keyint=150:min-keyint=150" -preset slow -crf 26 -map 0:a:0 -c:a:2 aac -b:a:2 64k -ac 1 -f mp4 out.360.mp4