Last active
August 29, 2015 14:22
-
-
Save amboxer21/1f987f037cf2d4ab4416 to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
mkv=$1 | |
if [[ ! -e $mkv ]]; then | |
echo -e "No such file or directory.\n"; | |
exit; | |
elif [[ $mkv == `echo $mkv | egrep "/"` ]]; then | |
parsed_name=$(echo $mkv | awk '{gsub(/\//, " "); print $NF}'); | |
parsed_path=$(echo $mkv | sed 's/\(\/.*\/\)\(.*$\)/\1/g'); | |
avconv -i ${parsed_path}$parsed_name -c:a copy -c:v copy ${parsed_path}${parsed_name}.avi; | |
else | |
avconv -i $mkv -c:a copy -c:v copy ${mkv}.avi; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment