Skip to content

Instantly share code, notes, and snippets.

@plembo
Last active September 23, 2021 20:49
Show Gist options
  • Save plembo/52d5e47213d07b51045bc774be3764e1 to your computer and use it in GitHub Desktop.
Save plembo/52d5e47213d07b51045bc774be3764e1 to your computer and use it in GitHub Desktop.
Bulk convert directory of files using ffmpeg

Bulk convert a directory of files with ffmpeg

A very simple bash one-liner. Note that the input and output formats can be anything that ffmpeg supports. In my case the input was a pile of (very old) short QuickTime videos of the kids that I wanted to play with more modern software.

Files that had been named something like "20031201.mov" before conversion, were renamed to "20031201.mp4".

$ for i in *.mov; do ffmpeg -i "$i" "${i%.*}.mp4"; done

Many people think that duct tape is the single most important invention of all time.

I would argue that the humble for loop may be even more so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment