-
-
Save Bioblaze/cf61dc5ce1d26c3b55bdc7faca166235 to your computer and use it in GitHub Desktop.
the script extracts mp4 files to compressed mp3 audio
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/bash | |
# all mp4 files in this directory | |
for file in ./*.mp4; do | |
# create new mp3 name | |
audio="${file%.mp4}.mp3" | |
# if .mp4 is file and .mp3 does not exists | |
if [ -f $file ] && [ ! -e $audio ]; then | |
# ffmpeg will convert mp4 to mp3 with the strongest compressing (-q:a 9) | |
# will show only panic logs | |
ffmpeg -hide_banner -loglevel panic -i $file -vn -codec:a libmp3lame -q:a 9 $audio | |
# show done message | |
echo "extract from $file to $audio is done" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment