[FFmpeg-devel] H.261 and H.263 RTP broken?

Alexandre FERRIEUX - FT/RD/SIRP/ASF/SOFTL alexandre.ferrieux
Thu Jan 29 14:44:21 CET 2009

Martin Lindhe wrote:
> Alexandre FERRIEUX - FT/RD/SIRP/ASF/SOFTL wrote:
>> Luca Abeni wrote:
>>> I heard of other people working on H.263 over RTP in the past, but noone
>>> ever posted a patch (AFAIK).
>> OK here is my little contribution. With this I correctly receive 
>> H263/RTP streams from a mobile phone. Forgive the naive style and 
>> overall bad quality, I'm a beginner with ffmpeg internals and I really 
>> thought somebody more knowledgeable would take over :-}
> I updated your patch against HEAD and made it compile.
> I can verity this patch makes H263 RTP decoding working correctly in my 
> scenario aswell (recieving H263 video from a SIP softphone).
> The patch should be cleaned up some but it does implement what is needed 
> for H263 video over RTP in ffmpeg!
> Great job Alexandre

Thanks Martin.

I see you righteously removed the need to get the M bit from the RTP 
layer (which is the subject of a nearby post and patch). This is indeed 
possible thanks to the following lines that were previously committed to 

+        case CODEC_ID_H263:
+        case CODEC_ID_H263P:
             st->need_parsing = AVSTREAM_PARSE_FULL;

With this you can also remove my alternate implementation, which is 
still there named "bad_h263_handle_packet". An d if you remove it, you 
can also get rid of the big PayloadContext (which is only needed in this 
extra-buffering implementation).

The reason I had done this initially was my ignorance of 
AVSTREAM_PARSE_FULL. After a bit of education thanks to Luca and 
Michael, I see this was an overkill (that would make sense for a codec 
where RTP-level packetization is the only way to parse the bitstream, 
like with the DTX packets in G729B).

Best regards,


More information about the ffmpeg-devel mailing list