Created
January 31, 2019 18:48
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original source: https://yohanes.gultom.me/2016/05/21/bash-script-to-batch-convert-mkv-to-mp4-linux/