[Matroska-devel] Duration (EBML: 44 89) in Seg inf part
Moritz Bunkus
moritz at bunkus.org
Wed Mar 6 13:41:41 CET 2013
Hey,
On Wed, Mar 6, 2013 at 1:33 PM, Peter Ivanov <qwerty123_1996 at abv.bg> wrote:
> Duration: 87.336s(00:01:27.336), but my hex value is 0x47AA9400
> In float this is 1202361344.00000
No, it's not. Note that in Matroska files are values are stored in Big
Endian byte order. Intel processors use Little Endian byte order. So
you cannot simply read the four bytes into a C "float" variable.
You'll have to byte-swap it as well.
Then you'll see that the float's value really is 87336.0; multiplied
by TimecodeScale (usually 1000000) you get 87 336 000 000 nanoseconds
=~ 87.336 seconds.
Kind regards,
mosu
More information about the Matroska-devel
mailing list