How can I convert an .mp3 to .flac?

6

Can someone tell me how I can convert an .mp3 audio file to .flac format using ffmpeg? I Googled extensively, but almost all resources point to converting .flac to .mp3, in such a way:

ffmpeg -i "input.flac" -ab 320k -map_meta_data 0:0 "output.mp3"

SexyBeast

Posted 2012-08-04T11:48:35.900

Reputation: 175

2Did you try ffmpeg -i input.mp3 output.flac already? – nohillside – 2012-08-04T11:52:17.943

Ummm, I just tried, and it works! Thanks. I thought that I will always have to put some metadata pertaining to the conversion while converting from one format to another. – None – 2012-08-04T12:00:47.563

1I'll make an answer out of it then. Metadata might improve the conversion process but is not really required usually. – nohillside – 2012-08-04T12:10:32.693

Converting from mp3 gets you worse quality, because mp3 is a lossy audio codec. – AnonymousLurker – 2012-08-04T13:58:27.150

3To elaborate on the previous comment: your MP3 file is lossy--meaning that it contains audio artifacts that may or may not be audible to you, but they're there. FLAC is a lossless codec that can preserve the quality of an original recording so that it's exactly as it was e.g. on the CD. But if you convert a poor quality MP3 to Flac, it's garbage in/garbage out--the poor quality doesn't magically get removed by converting to flac. – Rusty Monkey – 2012-12-13T18:44:18.443

@RustyMonkey a more likely scenario would even be: garbage in, worse garbage out. ;) – BloodPhilia – 2013-03-14T10:24:59.680

Answers

17

Did you try ffmpeg -i input.mp3 output.flac already?

nohillside

Posted 2012-08-04T11:48:35.900

Reputation: 506