On Thu, May 7, 2009 at 9:35 AM, Rusty Waters <[email protected]> wrote:
> Hi All,
>
> I am able to easily to decode only I-frames in MEPG-2 with avctx->skip_frame 
> = AVDISCARD_NONKEY. When I use this flag for decoding H.264, all frames are 
> decoded.
> Does anybody know what flags I have to set for H.264 to decode only I-frames. 
> Is this feature
> broken in H.264?
>
> Thanks, Rusty
>
>
>
>
>
> _______________________________________________
> libav-user mailing list
> [email protected]
> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>

How about something like

AVPacket pkt;
av_init_packet ( &pkt );
while ( av_read_frame(fmt_ctx, &pkt) >=0 )
{
  if ( decode_keyonly && (pkt.flags & PKT_FLAG_KEY) == 0 )
    continue;

  // proceed with avcodec_decode_video
  // ...
}
                
J.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to