[FFmpeg-devel] MPEG Video support in RTP

Luca Abeni lucabe72
Fri Aug 24 10:11:50 CEST 2007


Hi,

Luca Abeni wrote:
> Hi Luca,
> 
> Luca Barbato wrote:
> [...]
>>> ops... Sorry, I've been too fast in sending the patch. I updated my 
>>> local copy with the headers from rtp.{c,h}
>>>
>> If is still working as supposed please commit =)
> 
> Ok, thanks. I'll wait one day or two to give other people the 
> possibility to comment, and then I'll commit.

Ok, committed. Now, here are the interesting patches:

- remove_header_extension.diff: the current code writes an empty payload 
header extension if the video is MPEG2. However, this header is wrong 
(filled with all 0s), and according to the standard "its inclusion in an 
RTP packet is optional". Since removing this header we are still 
compliant with RFC2250 (even in case of MPEG2 video), this patch is 
removing it.

- fix_packetization.diff: this is the biggest patch. It ensures that a 
video frame is correctly split on frame boundaries, according to 
RFC2250. Note: the patch assumes that video sequence header, gop header, 
and picture header if present are at the beginning of a frame (I think 
this is guaranteed by the MPEG standard, right?), and that the first 
packet is big enough to contain such headers.
After applying this patch, the payload header is still wrong, but the 
frame should be correctly packetized, and we have all the information 
needed to fill the header. The patch is more complex than I would have 
liked, but I've not been able to come out with something simpler than 
this... Suggestions are welcome.

- set_bs_es.diff: trivial patch to correctly set the B (beginning of 
slice) and E (end of slice) bits in the payload header. After applying 
this, vlc is happy with the video streamed by ffmpeg!

- set_frame_type.diff: set the P field in the payload header. Note: in 
the patch, I assume that the frame is well-formed (I consider writing a 
non-well-formed frame similar to setting a wrong "size" field in 
AVPacket). Is this reasonable? If not, I'll add a check when reading 
frame_type

- set_tr.diff: set the TR field in the payload header

- set_begin_of_sequence.diff: set the B flag in the payload header

Note that I do not know about clients using the P, TR, and B fields... 
So I just checked them with wireshark, and after my patches they look 
reasonable. I still need to write the FBV, BFC, FFV, and FFC flags... If 
noone does this before, I will work on them next week (I need to find 
how to compute those fields based on the MPEG standard.


			Thanks,
				Luca
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: remove_header_extension.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070824/ff5512d8/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fix_packetization.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070824/ff5512d8/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: set_bs_es.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070824/ff5512d8/attachment-0001.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: set_frame_type.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070824/ff5512d8/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: set_tr.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070824/ff5512d8/attachment-0002.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: set_begin_of_sequence.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070824/ff5512d8/attachment-0002.txt>



More information about the ffmpeg-devel mailing list