Hi there, I was hoping somebody could offer advice on how to loop a
video with libavformat/libavcodec.

I have a filter graph created, so my core decoding code is basically:

if( (err = av_read_frame(inputCtx, packet)) < 0) {
    if(err != AVERROR_EOF) {
        /* handle errors, return */
    }
    avformat_seek_file(inputCtx,videoStreamIndex, 0, 0, 0, 0));
    avcodec_flush_buffers(codecCtx);
}

if(packet.stream_index == videoStreamIndex) {
    avcodec_send_packet(codecCtx,packet);
    avcodec_receive_frame(codecCtx,tmpFrame);
    av_buffersrc_write_frame(bufferSrcCtx,tmpFrame);
    if(av_buffersink_get_frame(bufferSinkCrx,frame) >= 0) {
        /* we have a frame */
    }
}

I'm not sure if there's steps that need to be taken to reset the filter
graph? Like is there a timestamp discontinuity?

It seems like this should work - but I'm missing something, it seems
like the buffersink_get_frame stops producing frames after I reset.

Thank you in advance,
-John
_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to