-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get the FrameRate of a video file? #105
Comments
caveat: I'm no expert. The likely reason for this might be that essentially every modern video format in use nowadays uses adaptive compression, with the sophistication of deploying higher frame rates only when they are actually most needed according to the varying complexity of the content signal, to maximize overall quality. This issue usually comes up when someone wants to know a "total count of how many frames" are in a given MP4. As far as I know, long gone are the days where that answer can be determined by multiplying a putative "FrameRate" by the length of the video in seconds. Note that this is not to say that a given video doesn't have a fixed number of frames that can be determined, usually only by enumerating and counting them in sequence. That total should remain a permanently conclusive value--but possibly only given the specific MP4 decoder configuration you just measured it on.. So my understanding is that both questions are somewhat meaningless nowadays? You would have to be more specific about what your ultimate goal for having this number is, in order to better choose from amongst the various available approximation methods or workarounds that might be avilable. |
All this is needed to track the position of the current frame, for a clear transition to the desired frame and end after the desired frame. Roughly speaking, easy video editing on the fly. |
Look at this PR #69 how to implement missing DirectShow functions. I added the framestep function which was initially not available on wpf-mediakit. Over there you can also find a commit with the framerate property you are looking for. |
Unfortunately, I couldn't find any examples of using non-implemented DirectShow methods. Where can I get more different examples? The site to which everyone refers https://wpfmediakit.codeplex.com/ has not been available for a long time. |
As mentioned, you can find the sample code here inside the active pullrequest #69 the commit link to review the code 76158bd |
I have looked all over the internet but there is no information anywhere. It is logical that the FrameRate parameter should be received along with NativeVideoWidth(Heigth), but it is not in any of the base classes.
How to get the number of frames per second of an open video?
The text was updated successfully, but these errors were encountered: