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-tp23030935p23030935.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
