[FFmpeg-user] Convert WAV to FLAC

CMG DiGiTaL cmarciog at gmail.com
Tue Mar 29 18:16:06 EEST 2022


I'm using the command below to convert from wav to flac:
ffmpeg -i "input.wav" -af aformat=s16:44100 "output.flac"

The bit-depth and sample_rate are ok, but is the command converting the
audio from CBR to VBR.

What should I add in the above command, or what command should I use for
the audio to keep the
CBR format in the FLAC output?

See the conversion results below:

Input information WAV file:

Input #0, wav, from 'C:\Users\CMG\Desktop\Genesis - I Can't Dance.wav':
  Duration: 00:04:05.67, bitrate: 1411 kb/s
  Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2
channels, s16, 1411 kb/s
    "streams": [
        {
            "index": 0,
            "codec_name": "pcm_s16le",
            "codec_long_name": "PCM signed 16-bit little-endian",
            "codec_type": "audio",
            "codec_tag_string": "[1][0][0][0]",
            "codec_tag": "0x0001",
            "sample_fmt": "s16",
            "sample_rate": "44100",
            "channels": 2,
            "bits_per_sample": 16,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/44100",
            "duration_ts": 10833900,
            "duration": "245.666667",
            "bit_rate": "1411200",

*Mediainfo* information input WAV file:

            "@type": "Audio",
            "Format": "PCM",
            "Format_Settings_Endianness": "Little",
            "Format_Settings_Sign": "Signed",
            "CodecID": "1",
            "Duration": "245.667",
           * "BitRate_Mode": "CBR",*
            "BitRate": "1411200",
            "Channels": "2",
            "SamplingRate": "44100",
            "SamplingCount": "10833900",
            "BitDepth": "16",
            "StreamSize": "43335600",
            "StreamSize_Proportion": "1.00000"



Output information FLAC file:

Output #0, flac, from 'C:\Users\CMG\Desktop\Genesis - I Can't Dance.flac':
  Metadata:
    encoder         : Lavf59.17.102
  Duration: 00:04:05.67, start: 0.000000, bitrate: 881 kb/s
  Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
    "streams": [
        {
            "index": 0,
            "codec_name": "flac",
            "codec_long_name": "FLAC (Free Lossless Audio Codec)",
            "codec_type": "audio",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "sample_fmt": "s16",
            "sample_rate": "44100",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/44100",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 10833900,
            "duration": "245.666667",
            "bits_per_raw_sample": "16",
            "extradata_size": 34,


*Mediainfo* information input FLAC file:

            "@type": "Audio",
            "Format": "FLAC",
            "Duration": "245.666",
           * "BitRate_Mode": "VBR",*
            "BitRate": "881543",
            "Channels": "2",
            "ChannelPositions": "Front: L R",
            "ChannelLayout": "L R",
            "SamplingRate": "44100",
            "SamplingCount": "10833871",
            "BitDepth": "16",
            "Compression_Mode": "Lossless",
            "StreamSize": "27070644",
            "StreamSize_Proportion": "0.99969",
            "Encoded_Library": "Lavf59.17.102"


More information about the ffmpeg-user mailing list