mp4

How to download an MP4 from YouTube, every time

I use yt-dlp to download videos off YouTube quite frequently. I'll use the videos as reference, and I often use it to grab the VOD for one of my livestreams, since there's no simpler way (I'm not going to dig through the bowel's of YouTube's UI to try to download one of my own videos...).

But I also can't handle the default .webm videos in all my video editing tools natively, and transcoding is annoying. So I've settled on the following yt-dlp command to first try to pull a native MP4 version off YouTube, and failing that, transcode to MP4 immediately after downloading:

yt-dlp -S res,ext:mp4:m4a --recode mp4 https://www.youtube.com/watch?v=dQw4w9WgXcQ

And if you weren't aware, yt-dlp does an excellent job pulling video files from other sites as well, should the need arise.

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.

2023 Update: The following one-liner works a bit faster, and doesn't require creating all the intermediate files as the original method below did:

ffmpeg -f concat -safe 0 -i <(for f in *.MP4; do echo "file '$PWD/$f'"; done) -c copy output.mp4

This command assumes you're running the command within the same directory as all your GoPro .MP4 files, and there are no other .MP4 files in that directory.

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

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.