[Ffmpeg-devel] dts, pts, duration, repeat_pic and others

Michael Niedermayer michaelni
Fri Jul 15 19:16:11 CEST 2005


On Friday 15 July 2005 02:28, Nicolas Roussel wrote:
> Hi all,
> I'm trying to write a very simple program that uses libavformat and
> libavcodec
> to retrieve and process images from a movie file (see the attached
> code).
> I'm having a hard time trying to understand how much time I can spend
> between frames to process the movie at nominal speed. 

frame.pts - last_frame.pts obviously

> I also have two 
> other
> packet-related questions (see the code).

> avcodec_decode_video(cctx, &frame, &got_picture, pkt.data, pkt.size) ;
>	 if (got_picture) {
>	 } else {
>	   // Question 1: what are these packets?

packets which dont give you a video frame :)
most likely its the first packet which doesnt output a frame due to the b 
frame reordering delay

>if (pkt.stream_index == video_stream) {
>    } else {
> // Question 2: why do I get these packets even if I specify
>	 // AVDISCARD_ALL for all non-video streams?

AVStream in avformat.h:
enum AVDiscard discard; ///< selects which packets can be discarded at will 
and dont need to be demuxed

the 'at will' should indicate that the demuxer can choose to ignore the 
discard parameter, if you dislike this, send a patch to discard them in  
av_read_frame() or another common place


More information about the ffmpeg-devel mailing list