parsingvideoffmpegwmvasf

How to parse WMV (ASF) file? Can't find length of data packets


I try to parse WMV (ASF) files without any SDK, just by decoding raw bytes. Now I have problem with ASF_Data_Object, where I can't find length of data packet. More precise, Single payload data packet.

See image: Sample

Here I have 9 packets, but unable to find size of individual packet. How I can determine border between packets?

I think, my problem at byte 0x411, where field "Length type flags". As you can see, here 0 value, so all flags are zero. Even Packet Length Type.

enter image description here enter image description here

Yes, 0 value here allowed here. But how to read this type of content?

This is now compressed payload, as replication data is 8, not 1. So, this is single payload without additional fields of size.

Sample of WMV file: https://files.catbox.moe/b51l2j.wmv


Solution

  • You seem to be having fixed size packets with no explicit payload length included, meaning that payload data size is derived from top level data object structure.

    Spec quote commented:

    enter image description here

    That is, the ASF data object carries 9 packets, 3200 bytes each, then internally the packets contain payload 3174 bytes of payload per packet except the last one which has less data and some padding.