Convert .flac to .mp3 with ffmpeg, keeping all met

2019-01-29 23:59发布

How can I convert .flac to .mp3 with ffmpeg, keeping all metadata (that is converting Vorbis comment in .flac files to ID3v2 metadata of .mp3)?

8条回答
We Are One
2楼-- · 2019-01-30 00:38

If you want to save a little space, try the recommendation of hydrogenaud.io:

Very high quality: HiFi, home, or quiet listening, with best file size -V0 (~245 kbps), -V1 (~225 kbps), -V2 (~190 kbps) or -V3 (~175 kbps) are recommended. These VBR settings will normally produce transparent results. Audible differences between these presets may exist, but are rare.

Source: http://wiki.hydrogenaud.io/index.php?title=LAME

If you want use this option in ffmpeg, you should use the -q:a 0 alias.

Control quality with -qscale:a (or the alias -q:a). Values are encoder specific, so for libmp3lame the range is 0-9 where a lower value is a higher quality. 0-3 will normally produce transparent results, 4 (default) should be close to perceptual transparency, and 6 produces an "acceptable" quality. The option -qscale:a is mapped to the -V option in the standalone lame command-line interface tool.

Source: https://trac.ffmpeg.org/wiki/Encode/MP3

If you want ID3v1 metatags too, you should add the -write_id3v1 1 parameter.

So my final command is:

ffmpeg.exe -y -i input.flac -codec:a libmp3lame -q:a 0 -map_metadata 0 -id3v2_version 3 -write_id3v1 1 output.mp3
查看更多
手持菜刀,她持情操
3楼-- · 2019-01-30 00:38

This flac2mp3.sh script uses ffmpeg to convert a folder tree of FLAC files into another folder tree of MP3 files. Cover art is included, when present. You can set a CORES variable to create background jobs to convert several files at a time.

查看更多
登录 后发表回答