Convert WAV to FLAC in FFmpeg

Solution 1:

FFmpeg's FLAC encoder supports sample bit depths of 16 and 24 bits, the latter padded to 32-bit. So for 24-bit, you will have to use a filter in-between.

ffmpeg -i in.wav -af aformat=s32:176000 out.flac

The above encodes to a 176 kHz 24-bit sample, stored as 32-bits. And the command below encodes to 16-bit and 44.1 kHz.

ffmpeg -i in.wav -af aformat=s16:44100 out.flac