Skip to content

Instantly share code, notes, and snippets.

@luckylittle
Created July 3, 2019 04:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luckylittle/bec98791c037d0837333ef89eea22f5d to your computer and use it in GitHub Desktop.
Save luckylittle/bec98791c037d0837333ef89eea22f5d to your computer and use it in GitHub Desktop.
Convert all MP4s in a folder to MKVs using MKVMerge
#!/bin/bash
# Requires: mkvmerge
for RH in *; do mkvmerge ${RH} -o $(basename -s .mp4 ${RH}).mkv; done; echo 'Done!'
# rm *.mp4
@luckylittle
Copy link
Author

Merge one *.mp4 and one *.m4a inside each directory into a *.mkv:

find . -name '*.mp4' -execdir sh -c 'mkvmerge -o "$(basename "{}" .mp4)".mkv {} "$(basename "{}" .mp4)".m4a' \;

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