user846400
user846400

Reputation: 1101

MJPEG streaming over RTSP

I am capturing JPEG images from an IP-camera over RTSP. I use live555 + libavcodec for streaming and decoding the MJPEG image. The stream works fine up to the image resolution 2048 x 1920. But when I increase the image width above 2048, I get a bar-shaped rectangular image of very small width (i.e., 544x1920). The image is correctly captured and saved on the camera. The problem occurs only when I stream the image over RTSP to the PC. Is there any payload restriction in RTP for high-resolution MJPEG?

Upvotes: 2

Views: 7910

Answers (2)

Romain Noizet
Romain Noizet

Reputation: 81

Please read https://www.rfc-editor.org/rfc/rfc2435 at the bottom of page 4. There, it is written that the maximum width of an image is 2040. A workaround is made possible with the ONVIF standard.

Upvotes: 8

Roman Ryltsov
Roman Ryltsov

Reputation: 69662

More likely, either decoder incorrectly decodes the image, or RTP client incorrectly reconstructs it. 2048 pixels is not a limit for JPEG (obviously) and RTP client does not deal a lot with parsing the bitstream, so resolution is not so important there (also the process reaches decoded image and does not fail completely on the way!).

Upvotes: 0

Related Questions