RTSP VS M-JPEG

Which is the best for me?

RTSP VS M-JPEG

There are two common Streaming technologies in use for IP (Internet Protocol) Cameras, these are RTSP (Real Time Streaming Protocol) and MJPEG (Moving JPEG).

RTSP is the newer of two and has some major benefits, although there are a few limitations which we will cover. 


To murky the waters further you might be wondering what ONVIF is and where the different manufacturers come into it? We'll get to that later too.

M-JPEG EXPLAINED

MJPEG is a video format where each individual frame of video is separated and compressed and transferred, almost like a digital version of an old movie reel.

Because each image is a snapshot in time it can however lend itself to High Quality images, when combined with High Quality image sensors on high end cameras. 


Also as each image is separate, a single dropped frame will not effect the complete stream of video.

MJPEG is a video only format, so cannot carry sound.

MJPEG is also much less secure as there can be no end to end encryption on the stream.

This format consumes a much greater amount of bandwidth than RTSP, by up to a factor of 10.As a result does not lend itself well to wireless transmission.

The lack of compression does however mean a decoding device such as a Computer, Recorder or Viewing device doesn't have to work so hard to decode, meaning lower CPU usage and cheaper hardware.

M-JPEG is a completely Open standard so there are no fee's to use it, which is part of the reason it is still in use right up to today.

Manufacturers sometimes add their own twist to M-JPEG, so having all M-JPEG equipment is no guarantee of compatibility, but in the main it varies little from manufacturer to manufacturer.

RTSP EXPLAINED

RTSP, or MPEG-4 was created in 1998 and as an improved and standardised format for IP video compression and transfer.

Unlike M-JPEG which is individual frames, RTSP only sends data of which pixels change since the last frame, meaning when there is not a lot of change, the data usage is much reduced in comparison. This is known as “Temporal compression“.

RTSP is able to carry more than just Video, allowing audio and also encryption so is a much more secure method of transfer.

RTSP's much smaller bandwidth requirement means WiFi cameras are much more a realistic prospect than with M-JPEG.

This protocol does take much more computing power to decode so your hardware requirements are higher on the receiving end, with modern fast CPU's and hardware costs tumbling this is not as much an issue as it was a few years ago.

RTSP is a standard, to be able to use it and to be able to wear the ONVIF standard badge it must work with other devices using the standard. 

WHO ARE ONVIF?

Who are ONVIF and how do they fit in? 


RTSP format was adopted by ONVIF (Open Network Video Interface Forum) which was founded by Axis Communications, Bosch Security Systems, and Sony Corporation amongst others.

The ONVIF was established to try and standardise the CCTV industry.


Although most companies signed up and started using the technology, there were a few who disagreed with it and tried to push a different format. As a result these companies never joined and as a general rule their cameras are only usable with their own systems or by third party software changing the format.


One of the companies who had reasons not to support this was Google, this is why you cannot use “Google Chrome” browser to directly view RTSP CCTV camera feeds, and cannot connect “Nest” cameras to an ONVIF compliant recorder.

Also a due to licensing costs, cheap or free CCTV viewer Apps tend not to support RTSP.

SO WHICH SHOULD I BE USING?

Really the situation and budget dictate the answer to this. 


As a general rule, if you are looking for a cheap way to capture and view images, without too much concern over bandwidth usage and security, you will be fine with M-JPEG equipment. 


If you are concerned about data security, if you are running multiple cameras on one network and have the budget to pay a slight premium for the benefits that brings, then RTSP is what makes sense. 


Certain manufacturers will actually put a primary feed in RTSP and a secondary in M-JPEG on their cameras. 

By doing this they allow you to turn on the second feed for compatibility with older/cheaper hardware if you need this. 

This can be great for integrating with lots of third party Apps and Hardware, just remember to turn off the feed when not needed as is a potential security risk if the RTSP steam is being encrypted.