1

I have a problem with FFmpeg when writing a pcm_f32le stream to a Wave64 file format (.w64).

Basically, only FFplay can read the file back correctly. I tried with VLC, but it seems it cannot read any .w64 files I have, then Audacity and Ardour can read it but it is heavily distorted.

Wave64 files with float32 samples created with Ardour do not have this problem, so this is not a codec to format incompatibility.

Moreover, it works fine when writing to a usual WAV file, but that defeats the purpose of Wave64 which I require. It also works fine when writing a Wave64 embedding a pcm_s16le, pcm_s24le or pcm_s32le stream. Only pcm_f32le into .w64 seems problematic from what I tested (could not check pcm_f64le).

I tried using a "volume" filter at the end of the chain, to no avail.

You can get a MWE using the following commands:

ffmpeg -f lavfi -i "sine=frequency=440:duration=5" test.wav
ffmpeg -i test.wav -c:a pcm_f32le test.w64

The resulting .w64 seems valid (FFplay, Audacity and Ardour can play it back), but only FFplay produces the expected audio.

This hints me -- but I might be wrong -- that it may simply be a header-related problem, but I don't know how to solve it, and hand-editing is not an option (except for debugging purposes) since it eventually has to be done on many files by people other than me.

I'm hoping there's an argument to FFmpeg that I missed... though ffmpeg -h muxer=w64 did not help, and the resulting .w64 file's codec is reported correctly as IEEE 32-bit by MediaInfo :-(

Please excuse me if this is not the right place to ask this question (I read on StackOverflow that "[q]uestions about interactive use of the command line tool should be asked on Super User or Video Production").

1 Answer 1

2

Actually, ffmpeg writes them correctly. Wave64 is a wav extension by Sony, and ffmpeg Wave64 with float samples play fine in Vegas Pro which reads these files using a plugin by Sony.

If you change the 65th and 66th bytes (0x40 & 0x41) to 03 00, they open fine in Audacity.

Alternatively you can write to rf64, which Audacity plays fine straight out of ffmpeg.

1
  • Thank you for the clarification. So, after all, there was a 'magic' parameter that would solve my problem: RF64 will be the way i shall take. Thank you very much!
    – Shuffle
    Nov 14, 2021 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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