AVFrame structure has a *reference* field. if it is 0, it means the current frame is not referenced and could have been dropped. unforutunately that is too late because in order to get an AVFrame you have to decode the packet :-(
unless you can somehow get the same information using the frame parser instead of the decoder? On Fri, Sep 25, 2009 at 08:57, Jean-Daniel Dupas <[email protected]>wrote: > > Le 25 sept. 2009 à 03:18, avcoder a écrit : > > On Fri, Sep 25, 2009 at 4:03 AM, Jean-Daniel Dupas >> <[email protected]>wrote: >> >> Hello, >>> >>> When I perform a seek, I have to decode all frames from the previous key >>> frame to avoid artifacts. Is there a way in avformat to detect that a >>> packet >>> is discardable and may be ignored (mkv and mpeg4/mov formats provide this >>> flag). >>> It may significantly reduce seek time for some file with large time >>> interval between key frames. >>> >>> Please call void avcodec_flush_buffers(AVCodecContext *avctx) after you >>> >> successfully perform seeking >> > > > Thank you but there is something I don't understand. > For example, I want to jump at frame at 10 second in the movie. > The key frames are at 8, 12, 16, etc. > > Correct me if I'm wrong but to properly decode the frame at 10s, I have to > decode all frames between the previous key frame (8 seconds) and the target > one (10 s). > Some container mark packet as droppable, which allow skipping some packet > while decoding frames between 8 and 10 s, so I can decode only required > frames to display the frame at 10s. > I didn't find any way to determine if a packet is droppable or not. > > Or did I miss a better way to do this ? > > Regards > > -- Jean-Daniel > > > > > > _______________________________________________ > libav-user mailing list > [email protected] > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > -- Aviad Rozenhek _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
