[FFmpeg-user] Sample types 's32 (24 bit)' and 's16 (24 bit)' are confusing to me

Zak ffmpeg-user-email at m.allo.ws
Sat Jan 27 19:58:23 EET 2018


Dear FFmpeg Community,

I have seen two sample types (similar to the output of -sample_fmts but 
maybe different) that confuse me because they are unclear about the bit 
depth of the samples involved. The two strange sample types are:

s32 (24 bit)

s16 (24 bit)

Those are verbatim strings. I have seen both of them, I am copy-pasting 
them from my log files.

I can see these either on calls to ffprobe or on calls to ffmpeg. Here 
is an ffprobe call that always reproduces the behavior:

bash> ffprobe "01 - Let It Go.flac"

ffprobe version 3.0.2 Copyright (c) 2007-2016 the FFmpeg developers
   built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
   configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl 
--enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx 
--disable-decoder=libvpx --enable-libmp3lame --enable-libtheora 
--enable-libvorbis --enable-libx264 --enable-avfilter 
--enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters 
--enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc 
--arch=x86_64 --enable-runtime-cpudetect
   libavutil      55. 17.103 / 55. 17.103
   libavcodec     57. 24.102 / 57. 24.102
   libavformat    57. 25.100 / 57. 25.100
   libavdevice    57.  0.101 / 57.  0.101
   libavfilter     6. 31.100 /  6. 31.100
   libswscale      4.  0.100 /  4.  0.100
   libswresample   2.  0.101 /  2.  0.101
   libpostproc    54.  0.100 / 54.  0.100
Input #0, flac, from '01 - Let It Go.flac':
   Metadata:
     ALBUM           : Megahits 2013
     ARTIST          : Idina Menzel
     COMMENT         : Vinyl rip by Radioactive Squirrel
     DATE            : 2013
     TITLE           : Let It Go
     TRACKTOTAL      : 18
     track           : 1
   Duration: 00:03:48.29, start: 0.000000, bitrate: 2701 kb/s
     Stream #0:0: Audio: flac, 96000 Hz, stereo, s32 (24 bit)

There it is, at the bottom of the ffprobe output, "s32 (24 bit)".

Here is how you reproduce it from ffmpeg, but this is not actually 
copy-pasted:

bash> ffmpeg -i "01 - Let It Go.flac" output.wav

# In the first chunk of printed output, about the input FLAC:

Stream #0:0: Audio: flac, 96000 Hz, stereo, s32 (24 bit)

# In the second chunk of printed output, about the WAV it is generating:

Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 96000 Hz, stereo, 
s16 (24 bit), 3072 kb/s

I am fairly certain the input FLAC is 24-bit (i.e. 24 bits per sample), 
and I am 99.9% certain the output WAV is 16-bit. Why does the FLAC say 
"s32", which refers to a signed 32-bit integer? Why does the WAV say 
"(24 bit)", which is simply not true?

Notice that I didn't actually supply a -sample_fmt argument to the 
ffmpeg call above. By default it chooses pcm_s16le and "s16 (24 bit)". I 
am not sure what happens if I call ffmpeg -i input.flac -sample_fmt s16 
output.wav but I could test that.

Thank you for any words of wisdom,

Zak



More information about the ffmpeg-user mailing list