Page 1 of 1

Conversion WAV -> FLAC and FLAC -> WAV shortens file

Posted: 18 Jul 2023 22:00
by Tanik
Hello,

I have recently reinstalled VLC media player and have discovered a problem (which may be a more serious bug).
As both WAV and FLAC are lossless codecs which store their data as PCM, the conversion from WAV to FLAC to WAV should produce an identical file (except for metadata).

However when I convert a WAV file with VLC into FLAC and then back into a WAV file, its file size decreases.
This is consistent across multiple iterations.
In fact I have set up a script with which I converted a 10sec WAV file repeatedly into FLAC and then back into WAV.
And indeed after 200 iterations the original 10sec audio file had been reduced to 0KB in size.

I would like to know whether this problem happens for other people too (which would likely make it a bug) or whether I did something wrong.

Here are my current specs:

VLC media player 3.0.18 Vetinari
Windows 10 Pro 22H2

The script which I used to convert WAV -> FLAC -> WAV ran these two commands repeatedly:

Code: Select all

vlc -I dummy wav.wav ":sout=#transcode{acodec=flac}:std{dst=flac.flac,mux=raw,access=file}" vlc://quit vlc -I dummy flac.flac ":sout=#transcode{acodec=s16l}:std{access=file,mux=wav,dst='wav.wav'}" vlc://quit
(if you need other specs or more information, please let me know)

Re: Conversion WAV -> FLAC and FLAC -> WAV shortens file

Posted: 19 Jul 2023 10:47
by Lotesdelere
dst=flac.flac,mux=flac

Re: Conversion WAV -> FLAC and FLAC -> WAV shortens file

Posted: 19 Jul 2023 15:00
by Tanik
Hey
I tried your suggestion, but regardless whether I use mux=raw, mux=wav or mux=flac (in all combinations) the same problem persists.
Thanks anyway

Re: Conversion WAV -> FLAC and FLAC -> WAV shortens file

Posted: 20 Jul 2023 10:01
by Lotesdelere
You should create a new report ticket on the VLC issues tracker with your above report and the link to this thread:
https://code.videolan.org/videolan/vlc/-/issues

If possible, because of this:
https://forum.videolan.org/viewtopic.ph ... 27#p538427