Skip to content

Instantly share code, notes, and snippets.

@theaccordance
Created January 31, 2019 18:48
Show Gist options
  • Save theaccordance/a57ea5da3d576804d7da4605f397d63d to your computer and use it in GitHub Desktop.
Save theaccordance/a57ea5da3d576804d7da4605f397d63d to your computer and use it in GitHub Desktop.
Batch script to recursively convert all .mkv files in a path into .mp4 files. Requires `avconv` dependency
#!/bin/sh
findpath=$1
: ${findpath:="."}
find "$findpath" -name '*.mkv' | while read f ; do
dir=$(dirname "$f");
file=$(basename "$f");
# ext="${filename##*.}";
name="${file%.*}";
# echo "avconv -i \"$f\" -codec copy \"$dir/$name.mp4\"";
avconv -i "$f" -codec copy "$dir/$name.mp4" </dev/null;
# rm -f "$f";
done
@theaccordance
Copy link
Author

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