How to retrieve total length and FPS of a wmv clip by WMV Format SDK

Started by
0 comments, last by kimryo 15 years, 8 months ago
How to retrieve total length of a wmv clip, any media time format(frames, seconds, etc) is ok. I've already search through the SDK document, it seems there is no explicit function to get this information. Loop through all file by GetNextSample to get total munber of frames would crash performance. And how to get the fps of a regular wmv clip? While the WMVIDEOINFOHEADER's AvgTimePerFrame is always empty by document. Any indication is appreciate. Thx in advance.
God create the world,we create another one.-Reference
Advertisement
Get total length of wmv via IWMHeaderInfo depends on whether the header of wmv stored TotalFrames attribute, while most of files do not saved with this attribute, so it is no a way to go;
Get fps via GetNextSample's return value maybe the 100% way to get fps, but, I've ever got a wrong value while the file can be normally play by Windows Media Player(Maybe the file is corrupt, but how can Windows media player play it rightly?).

Any one got any ideas?
Thx in advance.
God create the world,we create another one.-Reference

This topic is closed to new replies.

Advertisement