Can anybody reply to this? I have tried diferent things without success. Please help
amol mahamuni <[EMAIL PROTECTED]> wrote: Thanks, 1) Note that AFAIK PT 34 has been deprecated, and a dynamic payload type should now be used for H.263 video. => I get it from RTP header. 2) Did you remember to discard the extra bytes introduced by the payload header? => Yes. As per packet type (A/B/C) - I am discarding payload header bytes. Did you mean same ? 3) If you correctly removed the payload headers from the bitstream, I guess the bug is in this last pass. What do you mean by "is given to ffmpeg decoder"? Are you calling avcodec_decode_video() on the received bitstream? ==> Yes, I have initialized avcodec() and given this bitstream to avcodec_decode_video() 4) Did you correctly split it into video frames? ==> Yes. I think. I have just removed RTP header and H.263 Payload header. Is it sufficient? 5) Did you add FF_INPUT_BUFFER_PADDING_SIZE bytes to your input buffer? ==> What is this? Can you please provide some details? 6) Did you correctly initialise the decoder? What do you mean by "I am unable to get video frames"? Is avcodec_decode_video() failing? Or is it simply returning distorted images? Is the codec printing any error? ==> Yes. Decoder is initialized. I have tested my code with MJPEG stream. It can decode it very well. Then for H.263, I just changed decoder. I hope this is the only thing I need to change. avocdec_decode_video() is failing most of the times. When it succeeds, 1. It gives distorted image. 2. I checked height and width - it was CIF - which is correct in my case. 3. But data in picture (AVFrame*) is somthing wrong. Meaning - it says that data is YUV420P. And three buffers in (AVFrame->data[0],AVFrame->data[2],AVFrame->data[2]) has size (AVFrame->linesize[0] = 384 , AVFrame->linesize[0] = 192, AVFrame->linesize[0] = 192) which is wong I think. It shd be 352, 176, 176 4. Of 1600 packets, I only get 20 images which are distorted - or say curropted. Approximately, 4 packets constitutes 1 frame. So I should get around 400 packets. 7) I guess the simplest way to decode h.263 over RTP is to implement support for RFC2190 in the RTSP/SDP demuxer in libavformat (then, libavformat will take care of correctly splitting the stream in frames, etc...). ==> How to use libavformat? I only have libavcode.dll file. Is it available withing this (libavcode.dll) 8) BTW, RFC2190 looks very old and probably deprecated... Are you sure that your stream is encapsulated according to RFC2190 and not to RFC2429 or RFC4629? ==> I am new to this. How can I figure it out? 9) Following is the scenario. 1. I get video stream. I parse the header. Got PT=34 2. Removed payload header (4/8/12 bytes) 3. Colloected the bitstream until i get marker bit set RTP packet. 4. Fed it to FFMPEG (initilized ffmpeg, registred codecs, used avcodec_decode_video () function. What else I have to do? Thanks in advance - Amol. Luca Abeni wrote: Hi, amol mahamuni wrote: > Hello All, > > I have a query regarding RTP payload format for H.263. > I am following RFC 2190. > > I get RTP H.263 packets from RTSP server. I want to parse these packets and > fed the stream to decoder to get RGB frames. > > Following is the procedure that I used. > > 1. Paser RTP header part. This is 12 bytes header which contains payload > value 34 (so H.263 data) Note that AFAIK PT 34 has been deprecated, and a dynamic payload type should now be used for H.263 video. > 2. Next comes Payload header. This is H.263 header. I looked @ F and P bits > mentioned in rfc 2190. Depending upon valus for F and P, I come to know > packet type (A/B/C) - so payload header will be (4/8/12 bytes respectively). > > 3. I have concatenated H.263 bitstream data until I get RTP header with > Marker bit set. Did you remember to discard the extra bytes introduced by the payload header? > 4. Now this concatenated data is given to "FFMpeg" decoder (libavcodec.dll) > > I am unable to get video frames. If you correctly removed the payload headers from the bitstream, I guess the bug is in this last pass. What do you mean by "is given to ffmpeg decoder"? Are you calling avcodec_decode_video() on the received bitstream? Did you correctly split it into video frames? Did you add FF_INPUT_BUFFER_PADDING_SIZE bytes to your input buffer? Did you correctly initialise the decoder? What do you mean by "I am unable to get video frames"? Is avcodec_decode_video() failing? Or is it simply returning distorted images? Is the codec printing any error? > Questions:- > 1. Is there anything wrong in above procedure? This is difficult to say without more details (see above). > 2. While parsing RTP packets, I found that H.263 packet types are varying > between A/B/C - meaning - I get 1 packet of A-type, next is B type or > sometimes some C type packets. > Is this ok? This depends on the program which is creating the stream. > can anyone please help me resolving issue for decoding this? I guess the simplest way to decode h.263 over RTP is to implement support for RFC2190 in the RTSP/SDP demuxer in libavformat (then, libavformat will take care of correctly splitting the stream in frames, etc...). BTW, RFC2190 looks very old and probably deprecated... Are you sure that your stream is encapsulated according to RFC2190 and not to RFC2429 or RFC4629? Luca _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
