7

24-bit sample sizes are not at all uncommon for PCM/WAV data, so I was surprised to see this:

Invalid sample format 's24'

... when I ran this:

ffmpeg -i input.oga -y -f wav -ar 44100 -sample_fmt s24 -ac 2 output.wav

When I look at the ffmpeg FAQ page it says that it doesn't support signed 24-bit sample sizes.

Fair enough, but I'm having a hard time accepting that this very powerful tool which supports an impressively large number of formats is somehow missing support for this really common sample width.

All I can think of is that maybe it's a build configuration issue.

So this question is...

Is there some way to configure ffmpeg to include support for signed 24-bit WAV output?

Greg
  • 143
  • 1
  • 7

1 Answers1

6

There is no sample format to compactly store 24-bit samples, but they can be stored in 32-bits with padding. For that, select a 24-bit PCM encoder

ffmpeg -i input.oga -y -f wav -ar 44100 -c:a pcm_s24le -ac 2 output.wav

Run ffmpeg -encoders | grep 24 to get a list of all 24-bit encoders.

Gyan
  • 85,394
  • 9
  • 169
  • 201