Is it possible to have a lossless conversion from a wav file Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, 1 channels, s32, 1152 kb/s to a wav file ?

I tried using ffmpeg : ffmpeg -y -i KEEP_01.wav -acodec flac output.flac but i get this warning : Conversion will not be lossless. Incompatible sample format 's32' for codec 'flac', auto-selecting format 's16'

I also used sox but i had no warning so i don't know if the conversion was lossless or not.

Also i don't really understand the difference between sample_format and bits_per_sample in my ffprobe output :

"streams": [ { "index": 0, "codec_name": "pcm_s24le", "codec_long_name": "PCM signed 24-bit little-endian", "codec_type": "audio", "codec_time_base": "1/48000", "codec_tag_string": "[1][0][0][0]", "codec_tag": "0x0001", "sample_fmt": "s32", "sample_rate": "48000", "channels": 1, "bits_per_sample": 24, "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/48000", "duration": "0.810667", "bit_rate": "1152000" } ]


I realised I was using an old version of ffmpeg.

I tested with a more recent one and it worked fine.

  • That comment adds a lot more questions. – user477799 Mar 23 '17 at 14:43
  • @FleetCommand How so? That's what solved the OP's problem; there was some bug or unsupported feature in an old version. – slhck Mar 23 '17 at 15:31
  • @slhck This answer is written by the OP! Hence, I imagine there is nothing unclear to him. – user477799 Mar 23 '17 at 15:58
  • @FleetCommand You said “That comment adds a lot more questions” – I don't understand how. This is not a comment; it's a post in which the OP is answering their own question. – slhck Mar 24 '17 at 11:58

Your PCM is 24-bit samples in a 32-bit store, but the WAV doesn't seem to have flagged that correctly.

Try these two steps:

ffmpeg -i KEEP_01.wav -c copy out.wav

ffmpeg -i out.wav output.flac

FFmpeg's FLAC encoder only encodes to 16 or 24-bit sample formats. The latter is stored as 32-bit, just like your input.

  • Same warning with this additional option. Do you think my original wav file is badly encoded ? – Narthe Mar 22 '17 at 19:33
  • Try edited cmds. – Gyan Mar 22 '17 at 19:35
  • Same warning =P – Narthe Mar 22 '17 at 19:38
  • Upload a small portion of the WAV. – Gyan Mar 22 '17 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.