Hi, this is ususally done by using time_base in AVStream and PTS. Not exatly sure what you mean by frame number, but usually for timestamps PTS is used. Then you get that, it`s only a matter of multiplication with time_base to find out timestamp. for more information look at: http://dranger.com/ffmpeg/tutorial05.html Rytis Karpuška
--- On Fri, 8/6/10, Cuneyt Taskiran <[email protected]> wrote: From: Cuneyt Taskiran <[email protected]> Subject: [libav-user] creating millisecond time stamps from frame numbers To: "Libav* user questions and discussions" <[email protected]> Date: Friday, August 6, 2010, 9:47 AM Hi, In my program I would like to create timestamps (in milliseconds) for selected frames, given their frame numbers, e.g. frame 325. The current formula I use is long startTime = (long) floor (((double) startFrame / frame_rate) + 0.5; The question is: how to determine frame_rate. I found two parameters that are relevant, avg_frame_rate and r_frame_rate.Which one should I use? Also, is there an easier way, to calculate the timestamps rather than doing this way? Thanks! Cuneyt _______________________________________________ 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
