Skip to content

Instantly share code, notes, and snippets.

@matiaspl
Last active May 23, 2016 11:09
Show Gist options
  • Save matiaspl/2a5775d13249d21da465e667c59e6d83 to your computer and use it in GitHub Desktop.
Save matiaspl/2a5775d13249d21da465e667c59e6d83 to your computer and use it in GitHub Desktop.
Convert a bunch of MTS files from a camera to a sort-of-HTML5-compatible MP4's (while keeping the directory structure)
find /base_folder -name "*.MTS" -exec sh -c 'ffmpeg -n -i "$0" -c:v copy -c:a libfdk_aac "`basename "$0" .MTS`.mp4"' '{}' \;
Note:
The video track in the original MTS files most likely are H.264 High Profile, so they are not mobile-friendly.
Beware that the resulting MP4's may not play on older devices mobile. Change the base_folder according to your needs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment