Skip to content

Instantly share code, notes, and snippets.

@venam
Last active February 2, 2017 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save venam/3109f777509ffe31fc72 to your computer and use it in GitHub Desktop.
Save venam/3109f777509ffe31fc72 to your computer and use it in GitHub Desktop.
Convert flv to mkv
#!/bin/bash
if [ "$#" -lt 2 ]; then
echo "usage: ${0} <extension> <replace>"
exit 1
fi
for f in *.${1}
do
newname="${f%${1}}${2}"
echo "[*] $f to $newname"
$(avconv -i "$f" "$newname") || { echo "Can't convert"; exit 1; }
echo "[*] $f to $newname"
rm "$f"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment