I have a few thousand MP3 files and they are all of mixed bitrate.
I would like to run a program that can batch encode them all to 128 kbps. Are there any decent and free solutions for this for Windows?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityI have a few thousand MP3 files and they are all of mixed bitrate.
I would like to run a program that can batch encode them all to 128 kbps. Are there any decent and free solutions for this for Windows?
Simple:
here's a free one: http://winff.org
Run it and add all your files
then go to options button and the audio settings tab
and change audio bitrate to 128.
It will take a while and bring up a command prompt where it does its magic with ffmpeg
Advanced:
if you are into command lines, you can download ffmpeg and use the below command line to convert a file:
ffmpeg -i source.mp3 -vn -ar 44100 -ac 2 -ab 128 -f mp3 output.mp3
If you put it into a batch file, you can convert a whole bunch at once. mine looks like this:
---convert.bat----
set formats=*.mp4 *.flv
set presets=-vn -ar 44100 -ac 2 -ab 192k -vol 400 -f mp3
set outputext=mp3
for %%g in (%formats%) do start /b /wait "" "%~dp0bin\ffmpeg.exe" -i "%~dp0%%g" %presets% "%~dp0%%~ng.%outputext%" && TITLE "Converted: "%%g
--end---
My sister-in-law has about 9gb of music on the family computer and she continually screws up the machine. I then have to come over, transfer the music to a laptop, and then transfer it back after a reformat. She won't notice the difference in quality between 256 kbps and 128 kbps and the transfer time for her music collection will be almost cut in half.
I don't think the problem you have is converting mp3, but having a fast recovery process from your sister-in-law machine.
So, I suggest the following:
D:
for example). C:
is where you install your OS (I'm assuming it's Windows) and D:
is where you keep all personal files. It's possible to move "My Documents" to another folder.C:
drive, and record a dvd with it or store on the D:
partition. (You can try an OSS alternative to Ghost named Clonezilla as well)When your sister-in-law screws up the machine, you just need to restore the Ghost Image (in 10 minutes) in your C: drive. All files in D: are kept intact.
(If you don't like my suggestion and still want to reencode the mp3s, you can use foobar2000, a free windows audio player (it can convert files too) application.)
dbPowerAmp is what I use. There is a 21 day fully functional trial, and it can handle everything in batches.
Format Factory: http://www.pcfreetime.com/formatfactory/
Can bulk convert virtually any media format to any other. I have used this to alter resolution and bitrate on videos as well as downsample audio files.
This is going to take a very long time on 9 gb, but a naive approach that I'm using is to walk the folder structure, locate mp3s and plop anything that isn't already 128kbps into ffmpeg
which needs to be installed and on the path. I tested this on Windows but haven't benchmarked against any of the industrial-strength solutions. Use at your own risk--it destroys the original files.
To improve speed, you can fork a few processes for each available core either in the Perl script or manually and run each on a subset of the folders/files since the task is embarrassingly parallel.
# Convert files to mp3 recursively using ffmpeg, destroying originals
use strict;
use warnings;
use File::Copy;
use File::Find;
my $verbose = 0;
my $target_bitrate = 128;
# any mp3s above this bitrate will be converted to $target_bitrate
my $threshold_bitrate = 128;
sub process {
if (-f $_ && $_ =~ /\.mp3$/) {
my $file = $_;
my $info = `ffmpeg -i \"$file\" 2>&1`;
$info =~ /^\s*Stream.+Audio: mp3.+?(\d+) kb\/s$/m;
return if $1 <= $threshold_bitrate;
print "$file\n" if $verbose;
my $cmd = "ffmpeg -i \"$file\" -hide_banner -loglevel warning -vn ".
"-write_id3v1 1 -id3v2_version 3 ".
"-b:a ${target_bitrate}k \"____$file\"";
system($cmd) == 0 or die "$0: [$cmd] failed: $?\n";
move("____$file", $file) or die "move failed: $!";
}
}
find(\&process, $ARGV[0] || ".");
The best tool I found to handle audio (re-)encoding is fre:ac, it's free, open-source, cross-platform and has a user-friendly GUI.
Converting MP3 to MP3 can cause serious audio quality problems, it is best to convert them to .wav files first, then encode them back to your desired bit rate. Regardless of what method you use, the converted files will be of lesser quality than the original MP3.
DB PowerAmp is probably the best solution to keep the directory structures intact and is great for batch work.
DB Poweramp use to be free, there may be old versions (Version 10) of it floating around on the internet somewhere, http://www.videohelp.com/tools/dBpowerAMP, you will need to download codecs and install them After DB is installed.