[FFmpeg-devel] add MJPEG support into RTP output

Nash Tsai nash.tsai
Mon Apr 12 06:32:53 CEST 2010

Hi Luca,

On Fri, Apr 9, 2010 at 3:43 PM, Luca Abeni <lucabe72 at email.it> wrote:
> Nash Tsai wrote:
>> Hi,
>> On Fri, Apr 9, 2010 at 4:14 AM, Luca Abeni <lucabe72 at email.it> wrote:
>>> On 08/04/10 16:29, Luca Abeni wrote:
>>> [...]
>>>> Unfortunately, it seems that vlc does not like this stream (it prints
>>>> some errors, and does not display the video).
>>>> So, I suppose that setting q, type and tspec to 0 maybe is not a good
>>>> idea.
>>>> Or maybe the JPEG bitstream has to be processed somehow before inserting
>>>> it in the RTP payload (I did not read RFC 2435 yet).
>>> Ok; after a quick look at the RFC, it seems to me that "type" must be set
>>> to
>>> 0 for the YUV422 pixel format, and to 1 for YUV420. Moreover, the JPEG
>>> header should be removed from the payload (it is reconstructed by the
>>> depacketiser based on the payload header).
>> Can you specify which part of RFC states JPEG header should be removed
>> from the payload, although it is true that depacketiser is able to
>> reconstruct the whole JPEG image from RTP header with current
>> implementation?
> Section 3.1.9 "JPEG Payload":
> "The data following the RTP/JPEG headers is an entropy-coded segment
> consisting of a single scan. ?The scan header is not present and is
> inferred from the RTP/JPEG header. ... "
> Anyway, I just skimmed the RFC: if someone is able to make the thing
> work without removing the headers, I am ready to admit I might have
> misunderstood the text... But right now the proposed patch does not
> work (vlc is not able to receive the stream, and produces a lot of
> errors). If I change "type" to 1, and I remove the JPEG headers, vlc
> can display something (and stops to generate errors). The resulting
> video is still corrupted (everything looks green), but this can be
> due to the wrong value used for "Q".

By capture the RTP packet with Wireshark, if the RTP payload type is
26 the wireshark packet analyzer will assume that JPEG RTP Header is

> ? ? ? ? ? ? ? ? ? ? ? ?Luca
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel

Nash Tsai

More information about the ffmpeg-devel mailing list