Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
# if MP3 is out of limits then re-sample it if not then send it through
if [[ "${ext1}" == 'mp3' ]] ; then
# start bitrate 128 start bitrate 160
if [[ "${rateis}" -gt "${LameCheckRate}" ]] ; then
lame -V2 -b"${LameLowEnd}" -B "${LameHighEnd}" -F --vbr-new -m j -q2 "$FILENAME" "$newFile"
else
# if MP3 is within limits then skip resmapling then just make
# a copy to move it
# to new directory/folder
## WORKING SCRIPT DIRECTORY !
exiftool "${script_dir}"/"${newFile}"
cp "$FILENAME" "$script_dir"/"$newFile"
fi
fi # end first if
fi #END of if off of find working dir
So my script now uses -q:a 8 as the most obvios option. I use this script to re-encode and change the name of the file to be more readable:
Code:
#!/bin/bash
#
# DAB file name format is MMDDHHMM.MP2 03301414.MP" > 03-Mar-30-1414.mp3
#
MONTHS=(ZZZ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
for FF in *.MP2;
do
echo Processing $FF to ${FF:0:2}-${MONTHS[10#${FF:0:2}]}-${FF:2:2}-${FF:4:2}${FF:6:2}.mp3;
/usr/bin/ffmpeg -y -i "$FF" -acodec libmp3lame -q:a 8 ${FF:0:2}-${MONTHS[10#${FF:0:2}]}-${FF:2:2}-${FF:4:2}${FF:6:2}.mp3;
done;
exit
Just tried lame - seems a far better quality of re-encoding, so the files are from DAB radio, and the bit rates are ither 128kbps or 80kbps, no music just voice, plays and so on.
Lame has a number of presets and I've tried them all:
Code:
A few aliases are also available for ABR mode:
phone => 16kbps/mono phon+/lw/mw-eu/sw => 24kbps/mono
mw-us => 40kbps/mono voice => 56kbps/mono
fm/radio/tape => 112kbps hifi => 160kbps
cd => 192kbps studio => 256kbps
The original file is an MP2 wrapper size of 45MB 128kbps
I re-encoded using all options up to voice and this is what I found:
phone - acceptable, small file 6.2MB
sw - acceptable, file size 9.3MB
mw-us - okay, file size 15.2MB
voice - fine, file size 20.5MB
So I'm going to use sw or mw-us in future, great tip from BW-userx, cheers
#!/bin/bash
#
# DAB file name format is MMDDHHMM.MP2 03301414.MP" converted to 03-Mar-30-1414.mp3
# This makes it a bit more legible and using the month number make sure it sorts correctly
#
# Usage: lame --preset mw-us --tt "Episode 4" --ta "Inspector West" 03310600.MP2 Ep04.mp3
#
# lame --preset help
#
## A few aliases are also available for ABR mode:
## phone => 16kbps/mono phon+/lw/mw-eu/sw => 24kbps/mono
## mw-us => 40kbps/mono voice => 56kbps/mono
## fm/radio/tape => 112kbps hifi => 160kbps
## cd => 192kbps studio => 256kbps
#
MONTHS=(ZZZ Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
##PRESET=sw;
PRESET=mw-us;
TT="Afternoon Play";
TA="BBC R4";
for FF in *.MP2;
do
echo Processing $FF to ${FF:0:2}-${MONTHS[10#${FF:0:2}]}-${FF:2:2}-${FF:4:2}${FF:6:2}.mp3;
lame --preset $PRESET --tt "$TT" --ta "$TA" $FF ${FF:0:2}-${MONTHS[10#${FF:0:2}]}-${FF:2:2}-${FF:4:2}${FF:6:2}.mp3;
done;
exit
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.