Open dericed opened 8 years ago
For reference here's a file where the Segment size is less than its declared size (truncated file), http://samples.ffmpeg.org/archive/all/matroska+h264+vorbis++COLORS.mkv
I'm not sure what the block's size of 1470033 refers to.
It is the real size of the physical file. Said in other word, if
block[@name='Header']/@size + block[@name='Header']/data[@name='Size'] > @size
That means that the file is truncated.
Here's an example with test1.mkv from the mkv sample pack
mediaconch -v MediaConch Command Line Interface 16.04.20160530
includes in the result:
<block offset="24" name="Segment" size="14237">
<block offset="24" name="Header" size="8">
<data offset="24" name="Name">139690087</data>
<data offset="28" name="Size">23339305</data>
</block>
The file size is 23339337 bytes.
But ...... when I do:
mediaconch -mt -fx --force --ParseSpeed=1 /Users/davidrice/Desktop/Dave/matroska_test_w1_1/test1.mkv
then I get:
<block offset="24" name="Segment" size="23339313">
<block offset="24" name="Header" size="8">
<data offset="24" name="Name">139690087</data>
<data offset="28" name="Size">23339305</data>
</block>
So perhaps this test should require the coverage attribute to know if it should run.
Referenced file http://samples.ffmpeg.org/A-codecs/AAC/faad2-fail.mkv"
For most elements the block can follow this equation
block[@name='Header']/@size + block[@name='Header']/data[@name='Size'] = @size
That is: the declared size of the element's header plus the stored size of the data should equal MediaInfoLib's size that it reports about the entire block. In the above this is true for the
SeekHead
element but not true for theSegment
element.I haven't tested this widely but see it does work out with some files. I think this test is useful to find a truncated file, but not yet possible. I'm not sure what the block's size of
1470033
refers to.