Last active
October 9, 2019 10:30
-
-
Save zhanglianbo35/c5da0704fafa8ac925ed52225ca39e8d to your computer and use it in GitHub Desktop.
convert audio format opus (native) to mp3
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
for file in *.mkv | |
do | |
if ! [ -f "${file%.*}.mp4" ] ; then | |
echo "${file}" && ffmpeg -i "${file}" -acodec mp3 -vcodec copy "${file%.*}.mp4" | |
fi | |
if ! [[ -z $(grep '[^[:space:]]' "${file%.*}.mp4") ]] ; then | |
echo "Convert successful" | |
rm -f "$file" | |
else | |
echo "Convert failed, keep mkv as it is" | |
rm -f "${file%.*}.mp4" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment