MP3 conversion rate suggestions


I'm in the process of converting my FLAC files to MP3's for use on my iPhone. I will be using LAME. What have you found to be the best rate type (VBR, CBR etc.), & rate setting? That is, what saves the most memory, but provides the most acceptable sonics?
128x128mrmb

Showing 2 responses by sufentanil

For an iphone, I imagine that a 128kbps MP3 would be perfectly adequate. After all, what equipment do you plan to hook up to the iphone? I think that MP3 files between 128 kpbs and 192 kbps is an optimal point of sound quality to file size.

You'll need 4 programs (in Linux, at least): flac (to extract the audio info from FLAC files), metaflac (to extract tags from FLAC files), lame (to encode MP3 files), and id3v2 (to tag the MP3 files).

Using Linux, you would execute a command such as:

flac -d -o - "FLAC_FILENAME_HERE" | lame -b MP3_BITRATE_HERE -h - > "MP3_FILENAME_HERE"

Then, to copy the tags (this example is a subroutine in Perl that accepts thet FLAC and MP3 filenames as parameters and copies the pertinent tags from the FLAC file to the MP3 file):

sub copy_tag_data
{
my $FLAC_filename = shift;
my $MP3_filename = shift;

my %tags;
my $tag_parameter;

# Read FLAC file tags

$tags{'title'} = `metaflac --show-tag=TITLE "$FLAC_filename"`;
$tags{'artist'} = `metaflac --show-tag=ARTIST "$FLAC_filename"`;
$tags{'album'} = `metaflac --show-tag=ALBUM "$FLAC_filename"`;
$tags{'genre'} = `metaflac --show-tag=GENRE "$FLAC_filename"`;
$tags{'tracknumber'} = `metaflac --show-tag=TRACKNUMBER "$FLAC_filename"`;
$tags{'date'} = `metaflac --show-tag=DATE "$FLAC_filename"`;
$tags{'ensemble'} = `metaflac --show-tag=ENSEMBLE "$FLAC_filename"`;
$tags{'composer'} = `metaflac --show-tag=COMPOSER "$FLAC_filename"`;

foreach $tag_parameter (keys %tags)
{
# Strip the "TAG=" part out

$tags{$tag_parameter} =~ s|^.*?=||;

# Get rid of double quotes or backtics
# (convert them to single quotes)

$tags{$tag_parameter} =~ s|[\"\`]|\'|g;

# Remove trailing newlines

chomp ($tags{$tag_parameter});
}

# Now write these tags to the MP3 file

`id3v2 --song \"$tags{'title'}\" --artist \"$tags{'artist'}\" --album \"$tags{'album'}\" --TCON \"$tags{'genre'}\" --TRCK \"$tags{'tracknumber'}\" --TCOM \"$tags{'composer'}\" --TYER \"$tags{'date'}\" "$MP3_filename"`;

}

I hope that helps!

Michael
Tmesselt, the point of his using a lossy codec is to save space. At 320 kbps you're getting less of a size advantage relative to FLAC, which is what his original files are encoded in. So that's why I recommended the mid-range cbr settings (128-192).

As for cbr vs vbr, both are probably perfectly acceptable nowadays. There were issues in the past with compatibility using vbr in MP3's, but that's been solved for the most part. Why not try experimenting with both and see if you can perceive any sound quality differences? If not, choose the one that produces the smallest files.

Michael