[FFmpeg-devel] MPEG Video support in RTP

Luca Abeni lucabe72
Tue Aug 28 12:37:00 CEST 2007


Hi Michael,

On Mon, 2007-08-27 at 22:12 +0200, Michael Niedermayer wrote:
[...]
> > - 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.
> 
> id say looks ok unless our rtsp maintainer disagrees

Ok. I'll wait 2 days for Luca's comments, and then I will commit


[...]
> > +                            /* no slice at the beginning of the packet... */
> > +                            done = 1;
> > +                            end_of_slice = 1;
> > +                            len = r1 - buf1 - 4;

I just found this typo: this should be "len = r - buf1 - 4"


[...]
> if i understand this correctly it will never put more than 1 slice in a
> packet

Well, it should put more frames in a packet if the packet begins with a
startcode (begin_of_slice == 1). I just tested, and it seems to work.
For example, I just verified this by inserting some av_log() in
ff_rtp_send_mpegvideo():
1) ff_rtp_send_mpegvideo() has to send a 7255 bytes long MPEG2 frame
2) 1456 bytes are sent. These are 8 slices + the beginning of the 9th
slice
3) 79 bytes are sent. This is the end of the 9th slice. Since the packet
does not start with the beginning of a slice, no more slices can be put
in it.
4) 1456 bytes are sent
...

I admit that putting the beginning of the 9th slice in the first packet
is not a good idea (because it forces the second packet to be small)...
I'll try to do something better about this.


			Thanks,
				Luca





More information about the ffmpeg-devel mailing list