Sign in to follow this  
kimryo

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

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this