I have a bunch of audio files in a directory some are 128Kbps , some are higher.
I want to convert the ones with a bitrate higher than 128Kbps to 128Kbps to save space. I tried writing a shell script to do this:
#!/bin/bash FILES="*.mp3" for F in $FILES do newname=`basename "$F" -smaller.mp3` ffmpeg -i "$F" -acodec libmp3lame -ac 2 -ab 128k -ar 44100 "$newname.mp3" done But it also converts files that are already 128Kbps and therefore would take a lot more time to complete.
How could I check if a file`s bitrate is higher than 128Kbps and convert it down to 128Kbps only if so.
filecommand?