Hi,
I am using libavformat for demuxing MPEGTS files. My hardware decoder can
not be initialized until it receives the Header Frame.
I am giving the frames returned by av_read_frame() to Hardware decoder.
I tried using avformat_seek_file (), but it has no effect. The partial code
for it is:
if(isFirstFrame){
ret2 = av_read_frame(pFormatCtx, packet);
if (ret2 < 0) {
printf("first frame read frame failed");
}
int64_t initial_target = (int64_t)(packet->dts * 1);
ret2 = avformat_seek_file(pFormatCtx, videoStream, INT64_MIN,initial_target,
INT64_MAX, AVSEEK_FLAG_FRAME);
if (ret2 < 0) {
fprintf(stderr, "%s: error initial seeking\n", pFormatCtx->filename);
}
}
ret2 = av_read_frame(pFormatCtx, packet);
if (ret2 < 0) {
if (ret == AVERROR_EOF)
isLastFrame=1;
if (url_ferror(pFormatCtx->pb)){
printf("in url_ferror:");
break;}
usleep(10000); /* wait for user event */
}
Am I doing something wrong in it?
Is there any other way to directly seek to the Header frame?
Or is there any function that can determine weather a frame returned by
av_read_frame() is the Header Frame ?
Thank you
Amol
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user