The file is one big VOB file. I don't want to rely on any information that isn't actually included in the file that we are using - the application that will use this is being designed to work with any MPEG2 video stream like you would find on a DVD. To keep things independent, I need to determine the number of frames programmatically, without any user input or foreknowledge of the stream being analyzed.
I know the framerate information has to be in there somewhere, as the VOB file that I dump using mplayer is playable, and I can get correct framerate info out of players like VLC and the various mplayer frontends. Thanks for all the help, Sam sngardner wrote: > > Hey Guys - > > I need to figure out how to do a rough estimation of the number of frames > in an mpeg file. > > I would just figure out the number of seconds in the file by reading the > AVFormatContext info, and multiply by 30, but the duration field doesn't > always seem to be accurate. The file I am attempting to analyze seems, > based on mplayer's output, to change framerates from something higher to > the normal NTSC film standard after about 30 seconds. The duration field > seems to be set using the higher framerate, as, after doing the AVRational > math, I end up with a movie that the duration field says is one hour long > but in actuality is about an hour and fifteen minutes. > > The frame count I need doesn't need to be accurate, but this is far enough > off that it's causing problems. > > Does anyone have any idea how I might more accurately estimate the number > of frames, and also, how to read the framerate out of the video using > libav? > > Thanks a lot for the help > -- View this message in context: http://www.nabble.com/Estimating-number-of-frames-in-mpeg-tp23030935p23041073.html Sent from the libav-users mailing list archive at Nabble.com. _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
