Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Having Trouble With Wave64 Output
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
dloneranger
Posted: Aug 26 2012, 04:48 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



I'm rewriting WavNormailze, to cope with wave64's but I'm having trouble with the chunk headers of the wav file virtualdub outputs

They just seem a bit off
Here's the hex dump of the start of the file
The file length is 4226109992, $FBE55228
CODE
Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F

00000000   72 69 66 66 2E 91 CF 11  A5 D6 28 DB 04 C1 00 00   riff.‘Ï ¥Ö(Û Á  
00000010   28 52 E5 FB 00 00 00 00  77 61 76 65 F3 AC D3 11   (Råû    waveó¬Ó
00000020   8C D1 00 C0 4F 8E DB 8A  66 6D 74 20 F3 AC D3 11   ŒÑ ÀOŽÛŠfmt ó¬Ó
00000030   8C D1 00 C0 4F 8E DB 8A  28 00 00 00 00 00 00 00   ŒÑ ÀOŽÛŠ(      
00000040   01 00 02 00 80 BB 00 00  00 EE 02 00 04 00 10 00       €»   î      
00000050   64 61 74 61 F3 AC D3 11  8C D1 00 C0 4F 8E DB 8A   dataó¬Ó ŒÑ ÀOŽÛŠ
00000060   C0 51 E5 FB 00 00 00 00  00 00 00 00 00 00 00 00   ÀQåû            
00000070   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00                  
00000080   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00                  
00000090   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00                    


So, there's the riff header at 0, with length $FBE55228
(start+length) rounded up to next multiple of 8 = end of file+1, as expected

fmt chunk at $28, with length $28
(start+length) rounded up to next multiple of 8 = $50, as expected, the start of the data chunk

data chunk at $50, with length $FBE551C0
(start+length) rounded up to next multiple of 8 = $FBE55210, ummm now that's not what I expected
That is the (end of file+1) minus $18

There's no addition chunks at that position and as far as I can make out reading the specs, it should be equal to end of file+1

Am I interpreting the data incorrectly? Or is the data length wrong?
It's exactly off by the length of the chunk header (guid+int64)=$18


--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
dloneranger
Posted: Aug 26 2012, 07:58 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



If I've got this right then in AVIOutputWAV.cpp
void AVIOutputWAV::WriteHeader(bool initial)

in the block starting with
if (mbWriteWAVE64) {
CODE

if (!initial) {
*(uint64 *)&dwHeader[4] = mBytesWritten;
}

should be
CODE

if (!initial) {
*(uint64 *)&dwHeader[4] = mBytesWritten+24;
}


It didn't really help though, as part2 was wave64->aac, and I can't find an aac encoder that accepts wave64's
..... sigh......

Nevermind, I'll have to add a 'Save wav in just under 2Gb chunks' function to vdub

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
phaeron
Posted: Sep 2 2012, 09:17 PM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



Yes, this is a bug. Unlike regular RIFF, WAVE64 lengths include the chunk header. (Don't know why people do this in file formats... seems useless.) I'll fix it for 1.10.3.

As for your issue with AAC encoders that accept large streams, some do accept oversize WAV files if they are in stdin mode. This is used for live piping of data from one program to another and causes the encoder to ignore the main data length in the header.
 
    Top
dloneranger
Posted: Sep 2 2012, 09:32 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



stdin's a pain - there's all the passing # of channels, bitrate etc which doesn't lend itself to simple batch files

what I ended up doing was to modify WavNormalize to accept wav64 files and spit out multiple 1.9Gb files
then in the batch file, scan for multiple parts and pass them to neroaac as it's input

shame really, wav64 is such a simple modification I'm surprised it's not more widely accepted
the changes to the header lengths and padding alignment are just there to make life interesting for us.....



--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
3 replies since Aug 26 2012, 04:48 PM Track this topic | Email this topic | Print this topic

<< Back to Testing / Bug Reports