Page 1 of 3

.flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 9:57 am
by captaintrav
Of course I can google it, but I get a lot of results. I have been archiving my CD collection to .flac so I can toss the media. But my car can't play .flac files. I need something to do easy mass conversion to .mp3 and would prefer it uses LAME in a configurable fashion to do so. Either Linux or Windows solutions are of interest.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 10:12 am
by Flying Fox
WinLAME? Or you go full command line and do flac -> wav -> mp3 with LAME.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 10:13 am
by captaintrav
Flying Fox wrote:
WinLAME? Or you go full command line and do flac -> wav -> mp3 with LAME.

Oh, but then I'd have to put some effort into making a powershell script or something to do it in batches. :P WinLAME looks good though.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 10:17 am
by DragonDaddyBear
I use Foobar2000 for converting audio formats.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 10:48 am
by Captain Ned
dbPoweramp.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 11:09 am
by captaintrav
DragonDaddyBear wrote:
I use Foobar2000 for converting audio formats.


I didn't even know foobar did that, I just use it for playing music. You learn something new every day!

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 2:40 pm
by ChicagoDave
Yep I use foobar for converting FLAC to mp3 or WAV.

It's fully multi-threaded and takes less than 10 seconds on either of my two main rigs to convert a cd length album to V0 or WAV.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 2:44 pm
by Captain Ned
I love doing a big batch job with dBpoweramp and watching the 8 thread timers race each other.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 3:23 pm
by Jon
@echo on
for %%a in ("C:\FILES_TO_CONVERT\*.*") do ffmpeg -i "%%a" -vn -acodec libmp3lame -b:a 128k "C:\CONVERTED_FILES\%%~na.mp3"
pause

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 3:32 pm
by Captain Ned
128K. As if. WAV or nothing (space is cheap). On the one device where I have to use MP3 (because my !!_*%$#@$^# car 's head unit won't recognize lossless files), it's Lame -V0.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 4:02 pm
by Vhalidictes
Captain Ned wrote:
128K. As if. WAV or nothing (space is cheap). On the one device where I have to use MP3 (because my !!_*%$#@$^# car 's head unit won't recognize lossless files), it's Lame -V0.


Cap'n, while I share your hatred of 128K, higher quality MP3's are fine.

The only album that I've actually noticed any errors on was Stabbing Westward's "Darkest Days" - so much is going on in the background and LAME just can't figure out how to compress it, it just turns into audible mush. And that happens even at VBR0 (or 320K CBR, I've tried both).

But that's just one album from one artist. I've never encountered artifacting that I could hear in anything else, and my listening equipment probably exceeds my hearing ability.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 4:18 pm
by Captain Ned
Vhalidictes wrote:
Cap'n, while I share your hatred of 128K, higher quality MP3's are fine.

Hence the Lame -V0 flag. Averages 240K on a variable bit rate. -V-1 is fixed 320K. dBpoweramp gives me both choices for the one device that needs them.

I can buy a 512 GiB player, but it's the Astell&Kern AK380 and even at the discounted price of $2,999.00, it's beyond flat-out ludicrous. Why can't car companies (Subaru, I'm calling you out) simply buy decks (let's be honest, those are all 3rd party contract purchases) that recognize lossless files. I've got a perfectly-good 2 TiB portable in a "apocalypse" case that would gladly serve data to the head unit if only the head unit were willing to receive it.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 4:35 pm
by 001-deactivated
Seconded for dBpoweramp. You can batch process your entire music collection with sub-sub-subfolders from any format(s) to a single, lossy, compatible-with-your-device format in about four clicks. Mine is all organized and stored in FLAC so as soon as that new hotness format comes along all you have to do is click-click-click, hit convert, and in a few hours you've got maximum sound quality in any format you want. Change your mind on a better format? They keep releasing new codecs and updating old ones.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 4:42 pm
by Captain Ned
Dashak wrote:
Seconded for dBpoweramp.

The metadata and art retrieval capacities alone make it a winner. Been a happy customer for years now.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 4:50 pm
by Vhalidictes
Captain Ned wrote:
Dashak wrote:
Seconded for dBpoweramp.

The metadata and art retrieval capacities alone make it a winner. Been a happy customer for years now.


Ah, rippers. I recall you fondly.

I personally use "EZ CD Audio Converter", but dBpoweramp looks at least as good if not better. I could test/try Decibel, but then I'd need to actually track down an audio CD. Not sure where any are at this point.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 4:57 pm
by Captain Ned
Vhalidictes wrote:
I'd need to actually track down an audio CD. Not sure where any are at this point.

There's 300+ downstairs next to the audio rack and at least another 100 shoved in various spots in my "office". The less I say about my vinyl collection is the less you disparage me once again.

Music is a physical format, preferably analog. Yes, I'm one of those vinyl Luddites. The Ripping of the Vinyl awaits a new turntable (something in the Rega catalog most likely) that can do it justice. Also haven't settled on the proper ADC, which is the core of any vinyl ripping project.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 5:36 pm
by ClickClick5
Foobar 2000 with LAME plugin. Simple batch conversion capabilities!

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 5:43 pm
by Vhalidictes
Captain Ned wrote:
Vhalidictes wrote:
I'd need to actually track down an audio CD. Not sure where any are at this point.

There's 300+ downstairs next to the audio rack and at least another 100 shoved in various spots in my "office". The less I say about my vinyl collection is the less you disparage me once again.

Music is a physical format, preferably analog. Yes, I'm one of those vinyl Luddites. The Ripping of the Vinyl awaits a new turntable (something in the Rega catalog most likely) that can do it justice. Also haven't settled on the proper ADC, which is the core of any vinyl ripping project.


I'm not making fun of you at all, Cap'n. The simple fact of the matter is that all my ripping occurred from 1998 through 2005 (or so), which is roughly when I was seriously listening to music on a regular basis.

I've never owned more than a few dozen albums of my own, which is more down to the fact that my parents were both audiophiles with very different collections than anything else; Other than some 90's punk-lite and 00's industrial there really wasn't much for me to buy.

All of that Vinyl and Plastic is ~3500 miles away in a basement, my collection of mostly 320K MP3's is stable at about a terabyte and hasn't much changed in over ten years now. It's been about ten years since I've checked my now-secondary PC to see if that old ASUS DVD burner still works.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 6:12 pm
by Captain Ned
Vhalidictes wrote:
my collection of mostly 320K MP3's is stable at about a terabyte and hasn't much changed in over ten years now. It's been about ten years since I've checked my now-secondary PC to see if that old ASUS DVD burner still works.

My CD collection, all ripped to WAV, comes in at 339 GB according to Win8. Seems about right for the number of CDs I think I have. Vinyl will easily double that just from the noise through the ADC let alone the size of the collection.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 6:26 pm
by ClickClick5
Captain Ned wrote:
Vhalidictes wrote:
my collection of mostly 320K MP3's is stable at about a terabyte and hasn't much changed in over ten years now. It's been about ten years since I've checked my now-secondary PC to see if that old ASUS DVD burner still works.

My CD collection, all ripped to WAV, comes in at 339 GB according to Win8. Seems about right for the number of CDs I think I have. Vinyl will easily double that just from the noise through the ADC let alone the size of the collection.


Well the WAV file is static in terms of size per min, 5.29MB. So dead silence or pure chaos will come to be the same size. FLAC though...the size can be all over the place, but not exceeding the original WAV file.

EDIT: this is for 16/44.1 WAV files.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 6:33 pm
by just brew it!
728GB in FLAC format here. Mostly CD rips, but also includes some vinyl rips and digital downloads.

Digital downloads that come in MP3 format get converted to FLAC (even though there's a size penalty) to have a consistent archival format, and to have them in a lossless format for manipulation via Audacity (MP3 downloads frequently have minor beginning/end-of-track glitches, e.g. a few milliseconds of silence, which are noticeable on albums where there's not supposed to be any gap between tracks, so I edit those glitches out when I encounter them).

Most of the collection is also transcoded to OGG format, for my phone. Yes, I know... transcoding files that were originally in MP3 format to another lossy format is bad. But OGG is "transparent" to me at a lower bitrate than MP3, and I want to maximize the amount of music I can cram into the phone. I can't tell the difference unless I do a very careful side-by-side comparison, so it's good enough for mobile (car/bus/train) use. :wink:

Even at 160 kbit OGG sounds pretty decent. We've come a long way since the days of horrible MP3 encoders that made everything sound like it was being played underwater at lower bitrates, and introduced all sorts of other bizarre sonic artifacts even at high bitrates (I remember the encoder that came with early versions of MusicMatch JukeBox inserting random thumps, clicks, and dropouts all over the place).

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 6:55 pm
by ClickClick5
just brew it! wrote:
728GB in FLAC format here. Mostly CD rips, but also includes some vinyl rips and digital downloads.

Digital downloads that come in MP3 format get converted to FLAC (even though there's a size penalty) to have a consistent archival format, and to have them in a lossless format for manipulation via Audacity (MP3 downloads frequently have minor beginning/end-of-track glitches, e.g. a few milliseconds of silence, which are noticeable on albums where there's not supposed to be any gap between tracks, so I edit those glitches out when I encounter them).

Most of the collection is also transcoded to OGG format, for my phone. Yes, I know... transcoding files that were originally in MP3 format to another lossy format is bad. But OGG is "transparent" to me at a lower bitrate than MP3, and I want to maximize the amount of music I can cram into the phone. I can't tell the difference unless I do a very careful side-by-side comparison, so it's good enough for mobile (car/bus/train) use. :wink:

Even at 160 kbit OGG sounds pretty decent. We've come a long way since the days of horrible MP3 encoders that made everything sound like it was being played underwater at lower bitrates, and introduced all sorts of other bizarre sonic artifacts even at high bitrates (I remember the encoder that came with early versions of MusicMatch JukeBox inserting random thumps, clicks, and dropouts all over the place).


When possible, I try to find the least compressed version of the track. Be it CD, vinyl, WAV, ect. Then I'll flac it to my settings. currently, I have 131 of my CDs FLACed, at 60.8GB, then general dump of MP3s, aac, old itunes, ect is 31.4GB.

I started off saving everything at 160Kb/s MP3 back in 2000/2001 with MusicMatch on the old ME machine. And as time went on, and drive space became abundant and cheap, I bumped things to 256Kb/s AAC in itunes on the PowerMac G5, then 320Kb/s MP3, then finally around 2012, I decided to "clean up the library one last time" to make a final conversion. So I went with FLAC, and album artwork, a single standard naming format, ect.

Now if I need a lossy version, I'll convert it from the flac archive! I can't buy songs in lossy format anymore, primarily on the grounds of archive consistency.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 6:57 pm
by toki
Captain Ned wrote:
dbPoweramp.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 7:27 pm
by bitcat70
I used oggdropXPd to convert my FLAC's to ogg. Pretty easy to use. After configuring it I just dropped the files on it and let it go. Worked pretty well. LameDropXPd does the same thing but converts to mp3. Can also transcode from ogg.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 7:40 pm
by just brew it!
Just for completeness, here's my FLAC to MP3 transcoding script for Linux, "flac2mp3":
#!/bin/bash
dir="../../../MP3-new"
suffix=""
if [[ $# -ge 1 && $# -lt 3 ]]; then
    dir="$1"
    shift
fi
if [[ $# -ge 1 && $# -lt 3 ]]; then
    suffix="$1"
    shift
fi
if [[ $# -eq 0 ]]; then
    saveifs=$IFS
    IFS=/
    pathbits=(`pwd`)
    IFS=$saveifs
    pathlen=${#pathbits[@]}
    artist=${pathbits[$((pathlen - 2))]}
    album=${pathbits[$((pathlen - 1))]}
    artist2=`echo $artist | sed -e 's/&/\\\&/'`
    album2=`echo $album | sed -e 's/&/\\\&/'`
    if [[ "$suffix" != "" ]]; then
        album="$album $suffix"
    fi
    echo $artist
    echo $album
    if [[ -e "$dir/$artist/$album" ]]; then
        seq=1
        while [[ -e "$dir/$artist/$album ($seq)" ]]; do
            seq=$((seq+1))
        done
        album="$album ($seq)"
    fi
    artist2=`echo $artist | sed -e 's/&/\\\&/'`
    album2=`echo $album | sed -e 's/&/\\\&/'`
    mkdir --parents "$dir/$artist/$album"
    ls *.flac | sort | sed -e 's/ .*$/ "&"/g;s/" /"/g;s/.flac//g' \
     | sed -e "s:^:$0 \"$dir\" \"$artist2\" \"$album2\" :" | bash
    cd "$dir/$artist/$album"
    mp3gain -a -k -s r *.mp3
else
    dir="$1"
    artist="$2"
    album=$3
    album2=`echo "$album" | sed -e 's/([0-9]\+)$//;s/ \+$//;s/\[.\]$//;s/ \+$//'`
    track="$4"
    name="$5"
    if [[ `echo "$track" | grep '[0-9][0-9]-[0-9][0-9]-' | wc -l` -eq 0 ]]; then
        track2=`echo "$track" | sed -e 's/^\[//;s/\]$//'`
    else
        track2=`echo "$track" | sed -e 's/^..-//;s/-//;s/^ *//;s/^\[//;s/\]$//'`
    fi
    if [[ ${#track2} -eq 1 ]]; then
        track2=`printf "%02d" "$track2"`
    fi
    track3=`echo "$track2" | sed -e 's/^0\+//'`
    name2=`echo "$name" | sed -e 's/^-//;s/^ *//'`
    out="$dir/$artist/$album/$track2 $name2.mp3"
    flac --decode --stdout --silent "$track $name.flac" \
     | lame --preset standard --add-id3v2 --ta "$artist" --tl "$album" \
     --tn $track3 --tt "$name2" - "$out"
fi

You need to have lame, mp3gain, and flac installed.

It assumes that you have an artist/album directory hierarchy, with the individual track files starting with a 2-digit track number. Just run this script in each album directory. A parallel directory hierarchy is created for each album, rooted in the folder "MP3-new", in the directory above the directory containing your artist directories. E.g., if you're in ~/FLAC/Artist/Album, the transcoded files will be in ~/MP3-new/Artist/Album.

Meta-data for artist, album, track number and track name is constructed based on the path to the current directory and file names, and the album is processed through mp3gain to add track and album replaygain tags.

A trailing " [X]" (where X is any letter) on the album name is preserved in the directory naming scheme but not included in the generated meta-data (this is how I indicate whether an album came from CD, vinyl, or MP3 download). If an album with the specified name already exists in the target directory, a sequence number is appended to the directory name to make it unique (script won't overwrite an existing copy in the target directory).

You can batch process a whole set of albums by going to the top of your directory hierarchy and running:
ls -d */* | sed -e 's/^/pushd "/;s/$/"; flac2mp3; popd/' | bash

What can I say, I'm a CLI guy going way back, and when I started doing this stuff years ago there wasn't much in the way of decent GUI-based transcoding tools on Linux, so this is what I came up with. I still use scripts based on this general template for all of my transcoding.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 7:43 pm
by DancinJack
pfffft at anything in 2017 that doesn't play FLAC. No cars fo' me. For completeness, I don't really convert to MP3 anymore these days... I do have LAME installed somewhere though (which works through Foobar if I want too).

Then again, I really only play stuff on my computer (Schiit DAC+AMP) and my phone (Android 7.1.2) so I'm generally covered.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 7:48 pm
by just brew it!
DancinJack wrote:
pfffft at anything in 2017 that doesn't play FLAC. No cars fo' me. For completeness, I don't really convert to MP3 anymore these days... I do have LAME installed somewhere though (which works through Foobar if I want too).

Then again, I really only play stuff on my computer (Schiit DAC+AMP) and my phone (Android 7.1.2) so I'm generally covered.

All of my devices understand FLAC. It just takes up too damn much space. I store FLAC on my server at home, but mobile devices get a 128GB micro-SD card with the collection transcoded to OGG (it barely fits).

Sure, I could be more selective. But that would involve whittling things down a LOT, and I'd be constantly going, "Hmm, I haven't listened to X in a while... oh damn, that's not on the phone!"

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 7:50 pm
by curtisb
Back in the day I used to use EZ CDDA Extractor from Poikosoft. The name was changed to EZ CD Audio Converter a few years back. $29.95 life-time license, including all updates. I purchased mine over 10 years ago and I still have access to the newest versions (latest was just released a few days ago).

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 7:57 pm
by DancinJack
just brew it! wrote:
Sure, I could be more selective. But that would involve whittling things down a LOT, and I'd be constantly going, "Hmm, I haven't listened to X in a while... oh damn, that's not on the phone!"


I get it. This is what happens to me once in a blue moon. I don't mind switching stuff out though, which is usually how I do it. I understand though. It'd be "nice" to have it all, but I don't mind a little effort the way I do it.

Re: .flac to .mp3 conversion?

Posted: Wed Jul 12, 2017 7:58 pm
by jensend
The problem with Jon's command line is that it's CBR 128kbps. That really isn't enough for LAME to work with. But versions of LAME from the last ten years can do a very decent job with -V5 (variable bit rate 130kbps) and should be practically transparent at -V3 (VBR 175kbps), though the antiquated design of MP3 means a few problem samples can be found. Those are unlikely to really impact your listening, and the way to avoid them is not by asking for 320kbps but by using a better format.

All across the web, people's feelings about lossy music bitrates seem to be stuck with the assumptions they picked up in the 1997-2002 era. Those assumptions have to be adjusted for newer versions of LAME, and they have to be thrown out the window for the best modern codecs like Opus and xHE-AAC/USAC, which sound surprisingly good even at 64kbps.

It's worth having a lossless original around for encoding to different settings in the future (or for editing/remixes/etc if you're into that). If you can't have that, of course you want the highest quality lossy version available for the same purposes. But there's no reason to insist on >200kbps anything for listening purposes.

If you want to use a ffmpeg commandline for LAME like the one above, just replace -q:b 128k with -q:a 3 to get -V3 VBR 175kbps.