[FFmpeg-devel] add MJPEG support into RTP output

Luca Abeni lucabe72
Thu Apr 8 09:39:22 CEST 2010


shawn shawn wrote:
> Hi,
>     I've added MJPEG support into RTP output, please take look.

First of all, thanks for your contribution.
By looking at your patch, I am wondering why it's not possible to
use ff_rtp_send_data(), as done by the other packetisers (instead
of (splitting ff_rtp_inc_seq_num() and ff_rtp_build_rtp_header()
out of ff_rtp_send_data(), cannot you prepare the payloads of the
various packets in ff_rtp_send_mjpeg(), and then call
ff_rtp_send_data() for each packet?). See libavformat/rtpenc_*.c
for some examples.

Moreover, the RTP packetisation code for new payload types should
be implemented in separated .c files (so, you should add a
libavformat/rtpenc_mjpeg.c file containing ff_rtp_send_mjpeg().

Regarding the code: I am not sure if using a structure for JPEGHdr
(instead of directly filling the payload header, as done by the other
RTP packetisers) is a good idea or not. Moreover, why are the "tspec",
"type", and "q" fields always set to 0? If this really is the correct
thing to do, add a comment (referring to the relevant RFC).

Finally, can you add a reference to the RFC describing this payload
type, as a comment somewhere?

As a side note, which kind of player can be used to receive the
generated streams, testing this code?


More information about the ffmpeg-devel mailing list