I have three .mov files with video in Apple ProRes (apcn) and audio in PCM S24 LE (in24), of identical length and dimensions (1920x1080), frame rate (23.976024) and each with the same audio track. I'd like to:
convert to H.264 video and AAC audio, retaining very good quality (for public exhibition), and
generate a single widescreen video in H.264/AAC, i.e. it'll be 1920px times 3 wide and 1080px high.
For generating the widescreen I've worked out I can use this command assuming I've prepared the individual mp4 files:
ffmpeg -i left.mp4 -i centre.mp4 -i right.mp4
-filter_complex "[0:v:0][1:v:0][2:v:0]hstack=inputs=3" triple.mp4
Main Question:
Should I do the process in two steps -- (a) convert files, (b) make widescreen file -- or does that mean the widescreen video is re-encoded therefore it's worse quality? I'd like to keep the separate files so if there's no other impact then I'd prefer to do it as two steps. If I should do the conversion to H.264 at the same time as making the widescreen how do I combine the different commands?
Sub-Questions:
When preparing the widescreen I came across an alternative method using
overlay
like below. Is there any advantage either way? It seems like theoverlay
should be slower but in testing seemed about the same.ffmpeg -i left.mp4 -i centre.mp4 -i right.mp4 -filter_complex "[0:v:0]pad=iw*3:ih[bg]; [bg][1:v:0]overlay=w[leftcentre]; [leftcentre][2:v:0]overlay=w*2" triple.mp4
When preparing the widescreen, I think ffmpeg chooses the audio from just one of the input files. Since the audio is the same on each it doesn't matter to me which one. Is that right or is it in some way combining them?
Am I right in thinking a term like
[1:v:0]
in thefilter_complex
expression means 'second input, first video track only'?Here's my command to convert the .mov files, which seems to work as desired. Is there anything obviously wrong with it?
ffmpeg -i left.mov -c:v libx264 -preset medium -tune film -crf 16 -c:a aac -b:a 256k left.mp4
ffmpeg -i 1920_LEFT.mov -i 1920_CENTRE.mov -i 1920_RIGHT.mov -filter_complex "[0:v:0][1:v:0][2:v:0]hstack=inputs=3" -c:v libx264 -tune film -crf 16 -b:a 256k myOutputFile.mp4