mp4

How to join multiple MP4 files from a GoPro with ffmpeg

I recently shot some footage with a GoPro, and realized after the fact the GoPro 'chapters' the footage around 4 GB, so I ended up with a number of 4 GB files, instead of one larger file. There are various reasons for this, but in the end, I really wanted one long file, so it would be easier to synchronize with footage from another camera and my audio recorder.

So I found this answer on StackOverflow, which had exactly the commands I needed:

ffmpeg -i 1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i 2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i 3.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i 4.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc output.mp4

Note: If you use the 'High Efficiency' (HEVC) encoder for your GoPro videos, change h264_mp4toannexb to hevc_mp4toannexb in the above commands.

Convert .MTS file to .MOV or .MP4 on a Mac (for iMovie, etc.)

I recently received a few .mts files from a friend. These files are AVCHD high-definition video files from consumer-grade HD video cameras, and they've traditionally been a pain to work with.

If you have the files on your camcorder or an SD card from your camcorder, you can just open up iMovie '08 or iMovie '09 and click 'import from camera.' It'll take forever to transcode the files into something iMovie can use, but it will work. If, however, you're like me and you just have the files (no camcorder), you'll need to transcode the files before you can edit them or compress them further.

The easiest way to do this, in my experience, is to use Handbrake, the best/simplest transcoding software you can get on the Mac... and it's free! Don't pay any money for fancy GUI wrappers like the ones you'll find on mtsconverter.com, applemacvideo.com, mtsconvertermac.biz, etc... these are all ripoffs of ffmpeg, a free and open source video transcoding library.