i need to know why is that st->cur_dts get larger than pkt->dts
Have a look http://lists.mplayerhq.hu/pipermail/libav-user/2009-May/003034.html
It may help.
I've been chasing the "dts < pcr, TS is invalid" problem for 2 weeks now with
no final solution.
There was some work done at
https://roundup.ffmpeg.org/issue1279
and there have been some buzz at
http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2010-February/082896.html
but the last answer I got on libav-user was:
"It bothers me alot too, no solution yet, I think."
Nevertheless, my code (modified version of the code from the link above) looks
like this:
out_size = avcodec_encode_video(videoEncoderContext, outbuf,
outbuf_size, rescaledFrame);
if (out_size > 0)
{
AVPacket outpkt;
av_init_packet(&outpkt);
outpkt.data = outbuf;
outpkt.size = out_size;
outpkt.stream_index = 0;
if (videoEncoderContext->coded_frame->pts != AV_NOPTS_VALUE)
outpkt.pts= av_rescale_q(videoEncoderContext->coded_frame->pts,
videoEncoderContext->time_base, stream->time_base);
outpkt.flags |= (videoEncoderContext->coded_frame->key_frame) ?
PKT_FLAG_KEY : 0;
if (av_write_frame(outputFormatContext, &outpkt) < 0)
{
LOGCRITICAL( "unable to write" );
return;
}
}
I set neither pts nor dts for the AVPacket and even though I get "dts < pcr, TS is invalid" in the output console iPhone plays the result (and VLC most times) with no problems which is what I'm after. I tried to solve the original problem, but I can't so I settled for 'works for me'.
And please use a more descriptive title for your message when you start a new
thread ;)
Cheers
Tymek ([email protected])
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user