I'm having the same problem...I haven't come up with a solution yet and it seems like there may not be one other than reading then entire file. I'm not sure if nb_frames is ever set in an MPEG (MPEG-2/MPEG-TS for me) file. If you manage to solve the problem, please post again so I can see what you did (I'll also post if I come up with a solution).
On Sun, Jul 6, 2008 at 2:56 PM, Konran Gerber <[EMAIL PROTECTED]> wrote: > Hello, > > does anyone have a clue how to determine the frame count of an MPEG file > that has: > > 1. nb_frames == 0 in AVStream > 2. duration value in AVStream is only the calculated value of filesize > and bitrate > > In my test cases the duration value gives only about 80% of the real > MPEG video duration and > so I get a too small value for its frame count when I compute duration > with time_base values. > > When I try to position in the file with av_seek_frame with a very high > target position and flags > AVSEEK_FLAG_ANY, AVSEEK_FLAG_BACKWARD set I get a cur_dts value in AVStream > that matches the real frame count ... but: The whole file will be read > then which takes some minutes > on a 4.3G file. AVSEEK_FLAG_BYTE seems to work w'out reading the file > but I don't get a valid > cur_dts value in this case. > > Is there any way to get the frame count with libav w'out reading the > whole file? > > Regards, Konran > > _______________________________________________ > libav-user mailing list > [email protected] > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
