PDA

View Full Version : Junk chunk size calculation


d_wei
29th June 2007, 12:36
Hi,

I'm currently writing my diploma thesis.
It's about cutting OpenDML AVI Files in Java.
However, my question is:

how can i calculate the size of JUNK chunks in an AVI File?

May the field PaddingGranularity help in that case?

Here's a part of the avi's structure in xml-representation (I've written a tool, that extracts the metadata to a xml file).
Code:
<RIFF_AVI>
Pos: 0
id: RIFF whole chunk-length: 1884630016
content length: 1884630008
Format: AVI
<LIST_hdrl>
Pos: 12
id: LIST
whole chunk-length: 17112
content length: 17104
List-chunk-type: hdrl
<_avih_chunk>
Pos: 24
id: avih
whole chunk-length: 64
content length: 56
chunk has subchunks: false
MicroSecPerFrame: 40000
MaxBytesPerSec: 3788800
PaddingGranularity: 512
Flags: AVIF_HASINDEX, AVIF_MUSTUSEINDEX,
TotalFrames: 12514
InitialFrames: 0
Streams: 1
SuggestedBufferSize: 151552
Width: 720 Height: 576 Scale: 0 Rate: 0
Start: 0 Length: 0
</_avih_chunk>
<LIST_strl/>
Pos: 88
id: LIST
whole chunk-length: 16720
content length: 16712
.
SOME OTHER CHUNKS
.
</LIST_strl>
<_vprp_chunk>
Pos: 16808
id: vprp
whole chunk-length: 48
content length: 40
</_vprp_chunk>
<LIST_odml>
Pos: 16856
id: LIST
whole chunk-length: 268
content length: 260
</LIST_odml>
</LIST_hdrl>
<LIST_INFO>
Pos: 17124
id: LIST
whole chunk-length: 44
content length: 36
</LIST_INFO>
<_JUNK_chunk>
Pos: 17168
id: JUNK
whole chunk-length: 48356
content length: 48348
chunk has subchunks: false
</_JUNK_chunk>
<LIST_movi>
Pos: 65524
id: LIST
whole chunk-length: 1884363788
content length: 1884363780
List-chunk-type: movi
.
.
.
</LIST_movi>
<idx1_chunk>
AviIndexChunkPos: 1884429312
id: idx1
whole chunk-length: 200232
content length: 200224
</idx1_chunk>
<_JUNK_chunk>
Pos: 1884629544
id: JUNK
whole chunk-length: 472
content length: 464
</_JUNK_chunk>
</RIFF_AVI>

thanks in advance!