"Dipanjan Das" <[EMAIL PROTECTED]> writes: > Hi > > I am a new user of libmpeg2, and I intend to use the library for > basic functionalities like extracting the current frame in a file, > seeking to a given frame/time and so on. To begin with, I want to > extract the total number of frames in the file. After searching the > archives, I found that using mpeg2_skip(..., 1) for STATE_PICTURE > might be used, but this is working slow for large files (~531 MB). I > tried using mpeg2_skip(..., 1) for STATE_GOP too but that is not > very fast either. > > When a file as large as this one is opened in players like VLC or > Xine which are based on the same library, the total time length of > the file is displayed very fast. I was wondering how this can be > done using libmpeg2.
It can't be done in general. The programs you mention assume that the total length can be found by looking at the timestamps at the start and end of the file. This is almost always true, but it doesn't need to be. -- Måns Rullgård [EMAIL PROTECTED] _______________________________________________ Libmpeg2-devel mailing list Libmpeg2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmpeg2-devel