INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: [BUG] Convert Format creates incorrect wav header  (Read 753 times)

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4191
[BUG] Convert Format creates incorrect wav header
« on: December 02, 2018, 02:39:11 pm »

I used jriver convert format to extract audio from a film stored as a full BD folder. It's an 8 channel track and I simply selected wav as the output with no DSP applied. The resulting file seems about the right size (~ 9.2G for a 140min 7.1 track at 48kHz and 24bit depth) but it reports as approx 18mins long in a variety of other software.

e.g. in ffprobe

Code: [Select]
Input #0, wav, from '/home/matt/junk/The Hunger Games.wav':
  Duration: 00:18:16.90, bitrate: 71864 kb/s
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, 8 channels, s32 (24 bit), 9216 kb/s

Looking at the wav header (e.g. as per http://soundfile.sapp.org/doc/WaveFormat/) I see

chunk size = 2C 80 51 4B = 1263632428

which equates to a wav about 18 mins long

the value for Subchunk2Size is consistent with the error above as it has a value of 1263628288

The rest of the header is accurate but this error in the header  throws off many parsers.

I'll try a few more files to see if this is consistently wrong or whether it's limited to certain conditions.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4191
Re: [BUG] Convert Format creates incorrect wav header
« Reply #1 on: December 02, 2018, 03:47:06 pm »

I now realise this is because the file size is larger than that supported by the wav format.

I suppose it would be better if MC refused to create such a file rather than output an invalid one.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923
Re: [BUG] Convert Format creates incorrect wav header
« Reply #2 on: December 02, 2018, 03:48:22 pm »

WAV files have a 32-bit size header, it therefor cannot exceed 4GB without having a wrong size field. MC could try to calculate the output size and warn you, I suppose (although accurate information may not be fully available at the time), but there is a variety of tools that also just ignore the header and just keep reading the file.
Logged
~ nevcairiel
~ Author of LAV Filters

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14401
  • I won! I won!
Re: [BUG] Convert Format creates incorrect wav header
« Reply #3 on: December 02, 2018, 04:50:20 pm »

RF64/WAV64 for large WAV Files as on option?  Anyway, I use FLAC for such conversion and it works well.
Logged
JRiver CEO Elect
Pages: [1]   Go Up