[FFmpeg-devel] RTP mark bit not passed to parse_packet

Luca Abeni lucabe72
Thu Jan 15 11:00:46 CET 2009


Hi Alexandre,

Alexandre FERRIEUX - FT/RD/SIRP/ASF/SOFTL wrote:
> Hi,
> 
> In the process of writing an RTP depayloader for H263 (RFC2429, simple 
> follow-on packet mode), I see that the current API doesn't pass the RTP 
> Mark bit (buf[1]&0x80) to the payload handler callback.

Yes, the parse_packet() calback looks quite strange to me too...
It is not considering important information (like the M bit) and
has some other "interesting features", like the "*timestamp"
parameter...


> This makes it uneasy to detect the last packet of a frame in 
> RFC2429-packetized H263 (since the M bit means "end of picture in 
> current packet"). Of course the workaround is to wait for next RTP 
> packet which is not a follow-on, but this complicates the code and 
> introduces a 1-packet delay.
> 
> Am I missing something ?

I think the RTP de-packetiser is not supposed to split the stream in
frames, but simply to simply return the payload. libavcodec then contains
a parser (see libavcodec/h263_parser.c) that is in charge of splitting the
stream in frames. You just have to ensure that rtp_parse_open() sets
st->need_parsing = AVSTREAM_PARSE_FULL for H.263 too (as it already does
for mpeg video, and audio, H.264, etc...).

I agree that this should be improved (the current design is not robust
against packet loss, for example), but this is how things currently work
(as far as I understand). Anyway, I think that patches in this regard
are highly welcome ;-)


				Luca




More information about the ffmpeg-devel mailing list