How to display technical codec info for a FLAC file?

metaflac --list will display that information (and more) for all blocks in a FLAC file. You can additionally use --block-number=X, where X is the block you want to have information about, to only get information about that particular block.


Easiest is to use the Unix command line utility file. For example:

file "example.flac" 
example.flac: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 2474304 samples

You can use the ffprobe CLI tool that's included with ffmpeg:

$ ffprobe -hide_banner 10\ Ivory\ Tower.flac
Input #0, flac, from '10 Ivory Tower.flac':
  Metadata:
    ARTIST          : Van Morrison
    TITLE           : Ivory Tower
    ALBUM           : No Guru, No Method, No Teacher
    DATE            : 1986
    track           : 10
    GENRE           : Rock
    disc            : 1
    TOTALDISCS      : 1
    TOTALTRACKS     : 10
  Duration: 00:03:36.71, start: 0.000000, bitrate: 946 kb/s
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16

Shows the duration, bitrate, and particulars about the FLAC encoding. ffmpeg/ffprobe use the term streams, so the file we gave it is considered Stream#0:0.

You can get just those details:

$ ffprobe -hide_banner 10\ Ivory\ Tower.flac |& grep Stream
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16

Or if you really want to get at all the data from the stream use the -show_stream:

$ ffprobe -hide_banner  -show_streams 10\ Ivory\ Tower.flac
Input #0, flac, from '10 Ivory Tower.flac':
  Metadata:
    ARTIST          : Van Morrison
    TITLE           : Ivory Tower
    ALBUM           : No Guru, No Method, No Teacher
    DATE            : 1986
    track           : 10
    GENRE           : Rock
    disc            : 1
    TOTALDISCS      : 1
    TOTALTRACKS     : 10
  Duration: 00:03:36.71, start: 0.000000, bitrate: 946 kb/s
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
[STREAM]
index=0
codec_name=flac
codec_long_name=FLAC (Free Lossless Audio Codec)
profile=unknown
codec_type=audio
codec_time_base=1/44100
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
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/44100
start_pts=0
start_time=0.000000
duration_ts=9556764
duration=216.706667
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=16
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]

See references below for more examples etc.

References

  • ffmpeg Documentation
  • ffprobe Documentation
  • wiki:FFprobeTips