> This looks like the classical problem with lost packets, or out-of-order > packets. Is the decoder printing any error message on stderr? > Or maybe, it is simply due to a too low bitrate... > Anyway, this problem seems to be unrelated with the first thing you > described > (the first calls to avcodec_decode_video do not decode any frame).
stderr is empty. So I presume that everything is allright. >> But why does avcodec_decode_video() just decodes every other frame, when >> all frames are correct? I don't think thats a intended behaviour, or am I >> missing something? > > You are missing a clear description of the problem ;-) Above, you describe > distorted images; here, you talk about avcodec_decode_video() not decoding > some frames? I'm receiving frames through Live555 RTSP lib. Just before every frame is stored in file, I check the headers to see is it I or P frame. (We don't send any B frames, but that is not the issue, because when the same stream is read from a file it decodes perfectly). Now at this time I have a frame that starts with 00 00 01 b5 witch identifies as a valid frame. I have unsigned char* to the frame and I init context, decoder and decode the frame. Output == 0; Now if I try to decode exactly same frame again output == 200, and the frame is decoded and ready to be presented on screen. >>> Maybe you are seeing the usual decoding-order/display-order confusion? >>> I had problems streaming video with B frames in the past, but that was >>> caused by the fact that I was using DTSs as RTP timestamps (instead of >>> PTSs). >>> Try to check if you are correctly handling the timestamps... Yeah maybe. ( I really hope :-)) Thanks for the link. (wierd I didn't see that before.) But one question. Basically this tutorial use av_read_frame to read a frame into a AVPacket, but read it from a file specified by AVFormatContext. I however have frames comming one by one through network. How can I use AVPacket with individual frames? Can I fill it manually? If so, how can I read pts and dts from a frame, (presuming uint_t *data would be pointer to acutall data) ELMA Kurtalj d.o.o. (ELMA Kurtalj ltd.) Vitezićeva 1a, 10000 Zagreb, Hrvatska (Viteziceva 1a, 10000 Zagreb, Croatia) Tel: 01/3035555, Faks: 01/3035599 (Tel: ++385-1-3035555, Fax: ++385-1-3035599 ) Www: www.elma.hr; shop.elma.hr E-mail: [EMAIL PROTECTED] ([EMAIL PROTECTED]) [EMAIL PROTECTED] ([EMAIL PROTECTED]) [EMAIL PROTECTED] ([EMAIL PROTECTED]) [EMAIL PROTECTED] ([EMAIL PROTECTED]) [EMAIL PROTECTED] ([EMAIL PROTECTED]) [EMAIL PROTECTED] ([EMAIL PROTECTED]) [EMAIL PROTECTED] ([EMAIL PROTECTED]) _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
