[Live-devel] Live555 with ffmpeg's MJPEG codec

Ross Finlayson finlayson at live555.com
Thu Jul 17 23:09:32 PDT 2008


>Ok I have performed additional tests and it seems that not all JPEG 
>images can be transferred with RFC 2435

That's correct.  As the RFC explains, this payload format handles 
only a subset of the full JPEG standard.

>We can see that test2_out.jpg is perfectly reconstructed (even if 
>there are minor differences between the jpeg header from 
>test2_in.jpg and test2_out.jpg). Howerver, test1_out.jpg is not 
>reconstructed correctly. Major differences can be observed between 
>the 623 bytes of JPEG header of test1_in.jpg and test1_out.jpg. 
>Visually the test1_out.jpg is shifted horizontally and the colors 
>are off. The color/luminance problem may be attributed to the 
>conversion from the 0..31 quantizer value (ffmpeg mjpeg parameter) 
>to the more conventional JPEG's quality factor.

You may be able to overcome this by providing your own (i.e., 
non-default) quantization tables.  You can do this by implementing 
your own version of the virtual function
	quantizationTables()
in your "JPEGVideoSource" subclass.  (See 
"liveMedia/include/JPEGVideoSource.hh")

>  However, this does not explain why the image is shifted.

No, I can't explain this either.

As you've discovered, JPEG is a poor codec for video streaming, if 
only because its frames are much larger - on average - than those 
generated by other, video-specific codecs.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list