Last active
March 17, 2017 23:48
-
-
Save juanpablocs/3887801c32b5ce6a12d1c560de00ac53 to your computer and use it in GitHub Desktop.
ffmpeg mp3 rename tag or bitrate on demand
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 | |
#rename id3 album | |
#output file with "_.mp3" | |
for file in myfolder/*.mp3; do | |
ffmpeg -i $file -acodec copy -metadata album="Mysite.CoM" "$( sed -e's/\.mp3/_.mp3/g' <<< $file )" | |
# convert to 128kbps | |
#ffmpeg -i $file -ab 128k "$( sed -e's/\.mp3/_.mp3/g' <<< $file )" | |
done | |
#remove file size 0 | |
#move file with "_.mp3" to ".mp3" | |
for file in myfolder/*.mp3; do | |
if [ ! -s $file ] ; then | |
rm $file | |
fi | |
mv $file ${file//_\.mp3/\.mp3} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment