If IMediaDet::get_FrameRate = 0 - how get framerate?
And how to get frames count? If IMediaDet::get_FrameRate <> 0 i calculate
frames count as
IMediaDet::get_StreamLength / IMediaDet::get_FrameRate - is it correct?
wbr, Victor
> If IMediaDet::get_FrameRate = 0 - how get framerate?
You can try using the WM Format SDK 9.5. There are attributes Duration and
NumberOfFrames.
> And how to get frames count? If IMediaDet::get_FrameRate <> 0 i calculate
> frames count as
>
> IMediaDet::get_StreamLength / IMediaDet::get_FrameRate - is it correct?
Wouldn't it be '*' and not '/'?
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
Misprint - of course count_of_secunds * count_of_frames_per_second
WMV files do not always have constant framerates, so even if you do this, it
is not actually the frames per second you are retrieving, but an average
frames per second over the entire movie.
Regards,
Mark.
---
DirectEncode MPEG Encoder
Essien Research & Development
http://www.essien.de
Could it be that you are confusing framerate with bitrate? The encoded
framerate is constant. The playback framerate however can vary, when
the PC is under heavy load (frame drops).
Frames could also be dropped on recording, so the actual frames in the
file wouldn't be spaced uniformly and the framerate would not be
constant.
--
New to newsgroups? Read: http://dev.6581.com/newsgroups.html
No, I believe the WMV standard allows for variable framerate.
> No, I believe the WMV standard allows for variable
> framerate.
Let's be precise: the ASF container format, of which WMV is
just a re-branding, doesn't even know what a frame rate is.
Samples just have a timestamp that says when they need to be
displayed and timestamp intervals can be different for each
sample, which has the result of producing a variable frame
rate.
Of course, most of the time the intervals are the same
throughout the file and thus the frame rate happens to stay
constant.
The frame rate value in the *optional* extension header is
only the average rate computed from the average interval and
it is both optional and unreliable. There is also no way to
know whether this average comes from a constant rate or is
an actual average of a variable rate, so the value is mostly
useless unless you scan the file to see for yourself.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// a dot angeli at psynet dot net
> Mark Essien wrote:
>
>> No, I believe the WMV standard allows for variable
>> framerate.
>
> Let's be precise: the ASF container format, of which WMV is
> just a re-branding, doesn't even know what a frame rate is.
>
> Samples just have a timestamp that says when they need to be
> displayed and timestamp intervals can be different for each
> sample, which has the result of producing a variable frame
> rate.
Just for interest, the WM screen codec set to (say) 10 fps can easily have
10 seconds and more between frames - when nothing changes.
Iain
--
Iain Downs (DirectShow MVP)
Commercial Software Therapist
www.idcl.co.uk