Transcode Flac a MP3 on GNU Linux systems

sábado, junio 11, 2016 , 0 Comments

FLAC (Free Lossless Audio Codec):

Is an audio coding format for lossless compression of digital audio, and is also the name of the reference codec implementation. Digital audio compressed by FLAC's algorithm can typically be reduced to 50–60% of its original size and decompress to an identical copy of the original audio data.
FLAC is an open format with royalty-free licensing and a reference implementation which is free software. FLAC has support for metadata tagging, album cover art, and fast seeking. Since FLAC was introduced in 2001, the number of products and services using the format has increased. It is generally supported by more hardware devices than competing lossless compressed formats that may have intellectual property constraints.

Constant Bitrate (CBR) :

When encoding a constant bitrate (CBR) file, the user (you) chooses a preset bitrate and LAME targets that bitrate throughout the entire file. This means that every second in the file has the same number of bits, no matter how simple or complex the sound is. Every second in a CBR file has the same quality. Because silence is given the same number of bits as more complex sounds, CBR files are larger than VBR and ABR files of the same quality. This also means that CBR files have a predictable file size.

Variable Bitrate (VBR) :

When encoding a variable bitrate (VBR) file, the user (you) chooses a preset quality and LAME targets that quality, letting the bitrate vary throughout the entire file. This means that every second of the file has a different number of bits that depends on how complex the sound is at that second. For example, a second of silence would receive much fewer bits than a second of loud, blaring music. Since VBR files target a certain quality instead of a certain bitrate, exact VBR file sizes are more unpredictable. LAME has certain VBR presets ranging from V0 to V9. V0 is the highest quality VBR preset and V9 is the lowest quality VBR preset. The two most common VBR presets on What.CD are V0 (with a target bitrate of 245kbps) and V2 (with a target bitrate of 190kbps). V2 is the lowest quality LAME VBR preset allowed on What.CD for music torrents. At a certain VBR preset setting, the average bitrate throughout the file is usually close to thetarget bitrate. However, keep in mind that the target bitrate is just a target — the average bitrate will not necessarily end up near the target bitrate.


 When encoding an average bitrate (ABR) file, the user (you) chooses a preset bitrate and LAME allows the bitrate to vary throughout the entire file, but the average bitrate of the file will be the bitrate you preset. This means that like CBR, the file size is predictable, and like VBR, the quality and bitrate of the music varies throughout the file depending on how complex the music is each second. However, ABR is not recommended by What.CD because it is a mix of both CBR and VBR, and it is thus unable to perform well on either. (Jack of all trades but master of none.)


Una transcodificación buena significa que el archivo nunca ha sido convertido de un formato de perdida a otro con mas perdida. También significa que solo ha sido convertido con perdida una ves en el ultimo y único paso.

Ejemplos de buenas transcodificaciones:

    uncompressed lossless → compressed lossless
    compressed lossless → uncompressed lossless
    compressed lossless → compressed lossless
    uncompressed lossless → lossy
    compressed lossless → lossy
Source:( En Wikipedia &


Install FFMPEG:

On Debian systems  just execute as superuser:

apt-get install ffmpeg


Just open an comand line terminal, enter the folder where are located the Flac files, choose one of the follow formats:

 Transcode to MP3 V0:

for f in *.flac; do ffmpeg -i "$f" -aq 0 "${f%.flac}.mp3"; done

Transcode to MP3 V0:

for f in *.flac; do ffmpeg -i "$f" -aq 2 "${f%.flac}.mp3"; done

Transcode to MP3 320Kbps:

for f in *.flac; do ffmpeg -i "$f" -ab 320k "${f%.flac}.mp3"; done

If just only  need to transcode one file, we don't need a "for" loop, in this case MP3 V0, type this:

ffmpeg -i nombrefichero.flac -aq 0 nombresalida.mp3

0 comentarios: