Quantcast
Channel: Filmmaking – In LA
Viewing all articles
Browse latest Browse all 20

An ffmpeg recipe to concatenate multiple quicktime files and convert to h264

$
0
0
If you ever find yourself with a set of same-as-source quicktime files that have been exported from Media Composer, one per reel of a film…

–and you need to output a single h264 file of the film to upload to Dax or Pix or another of the various secure media platforms…

–and you know your way around the Unix command line and have ffmpeg installed on your machine…

–then you’re in luck. Here’s how to use these tools do what you need.

First, construct a text file that lists the files you mean to compress. My “mylist.txt” file contained the following lines:

file 'REEL 1V7 042914.mov'
file 'REEL 2V11 042914.mov'
file 'REEL 3V7 042914.mov'
file 'REEL 4V8 042914.mov'
file 'REEL 5V6 042914.mov'
file 'REEL 6V7 042914 fix.mov'
Put the mylist.txt file in the same directory as the source files, and also use the ‘cd’ command to switch your shell session into that directory so that long paths won’t be needed. Then, run this ffmpeg command (I wrote it as one line, but broke it up here with the ‘\’ character at the end of each line so that it’d be readable):
time ffmpeg -f concat -i mylist.txt -framerate 23.976 -s hd720 -c:v libx264 \
-preset slower -profile:v baseline -g 24 -deblock 0:0 -c:a libfaac -b:a 96k \
-movflags rtphint+faststart -vb 2500k -pix_fmt yuv420p -f mp4 -threads 80 outputfilename.mp4
45 minutes after I did this, I had a single mp4 file containing all the reels in order, as h264. I checked all the transition points between reels and there were no glitches.

This saved me from having to stay at work an extra 4 hours that night, waiting for Media Composer to export a full-length same-as-source movie and then converting it to h264.

I know what you’re thinking, “Why not just export to h264 from within Media Composer?”. Two reasons: Going to h264 directly from within Media Composer is slower than exporting same-as-source and feeding it into ffmpeg, and Media Composer’s h264 output doesn’t support as many options for hinting for streaming as were required for that upload.


Viewing all articles
Browse latest Browse all 20

Trending Articles