Log in

View Full Version : wmv file structure: calculate fps


websmrf
22nd August 2011, 16:54
Hello forum,

I hope my first post finds your interest and has been put in the right place; if not, I ask a moderator to move it where it should be.

I am looking for advice about how to calculate a wmv's fps when there is no Extended Stream Properties Object GUID (14E6A5CB-C672-4332-8399-A96952065B5A) present.

Usually, you would often find such a GUID in a wmv, and then simply obtain the fps as

fps = 10000000 / extended_stream_properties.avg_timeperframe


I note that avisynth's DirectShowSource also throws an error when this GUID is missing, and demands you to explicitely indicate the fps, so it seems my problem is not totally trivial. Also GSpot does not bring up the fps.

I notice that both mediainfo and ffmpeg are capable to determine or calculate the correct value for fps, but I haven't been able to identify the respective logic within either source code.

To be complete, these are all the GUIDs of a sample file (offset:GUID:name):

0000:75B22630-668E-11CF-A6D9-00AA0062CE6C: Header Object
001E:8CABDCA1-A947-11CF-8EE4-00C00C205365: File Properties Object
0086:5FBF03B5-A92E-11CF-8EE3-00C00C205365: Header Extension Object
00B4:B7DC0791-A9B7-11CF-8EE6-00C00C205365: Stream Properties Object
00 2F 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 ./..............
00 00 00 00 EF A1 F4 80 ....ï¡ô€
0139:B7DC0791-A9B7-11CF-8EE6-00C00C205365: Stream Properties Object
00 00 00 00 01 00 00 00 00 00 01 2D 02 2D 02 01 ...........-.-..
00 00 ..
01AB:86D15240-311D-11D0-A3A4-00A0C90348F6: Codec List Object
Codec Name: wmv2
Codec Description:
57 4D 56 32 WMV2
Codec Name: Windows Media Audio V8
Codec Description:
61 01 a.
0225:75B22636-668E-11CF-A6D9-00AA0062CE6C: Data Object
F2D7:33000890-E5B1-11CF-89F4-00A0C90349CB: Simple Index Object


I have also dumped the extra data at the end of the two Stream Properties Object GUIDs, and the short Codec Information bytestream contained in the two Codec List Objects, but unfortunately I am lacking further documentation regarding their content and layout.

Probably I'm looking totally in the wrong place, or there is a far more easy calculation available.

Thank you for your interest and your help.

w.