MJPEG, H.264 and H.265 are the 3 common methods that CCTV system records and store video. The same/similar methods are used by various other video streaming services, e.g. YouTube, Netflix to store/stream video to users as well.
|Mid 1990’s||MJPEG||Video (VCD)||Bad|
MJPEG is a series of individually compressed picture. Think of it as a continuous stream of JPEG picture being sent to the user.
As each frame(picture) is individually compressed without considering the other frame(picture), the resultant file size is very large in comparison to other form of compression technique. It’ll take 5 to 20x the storage space to store the same length of video as H.264 compression.
The only clear advantage MJPEG has is because it has been around since the Mid 1990s, most of the browser supports MJPEG like JPEG without requiring any additional plugin/addons to the browser.
H.264 is a video compression standard based on block-oriented, motion-compensated integer-DCT coding. It is by far the most commonly used format for the recording, compression, and distribution of video content, used by 91% of video industry developers as of September 2019. It supports resolutions up to and including 8K UHD.
H.264 was standardized by the ITU-T Video Coding Experts Group (VCEG) of Study Group 16 together with the ISO/IEC JTC1 Moving Picture Experts Group (MPEG).
H.264 is perhaps best known as being the most commonly used video encoding format on Blu-ray Discs. It is also widely used by streaming Internet sources, such as videos from Netflix, Hulu, Prime Video, Vimeo, YouTube, and the iTunes Store, Web software such as the Adobe Flash Player and Microsoft Silverlight, and also various HDTV broadcasts over terrestrial (ATSC, ISDB-T, DVB-T or DVB-T2), cable (DVB-C), and satellite (DVB-S and DVB-S2) systems.
This means that if you are using standard H.264 compression, the video file recorded will be playable across common video player software, e.g. VideoLan, Windows Media Player.
H.264 is supported in over 90% of surveillance CCTV camera systems and is considered the industry standard.
H.264 is also used in ONVIF (Open Video Network Interface Format) support for cameras. This allows for different manufacturers equipment to communicate with each another.
H.264 had also been around for more than a decades, but why isn’t it natively supported in all browsers like MJPEG ? Basically there’s a patent/video standard war in between the major technology companies (Google, Apple, Mozilla, Nokia, etc) akin VHS/Betamax war in the 70/80s. Due to this, H.264 is not natively supported in some of the browsers.
H.265 is a video compression standard designed as part of the MPEG-H project as a successor to the widely used H.264. In comparison to H.264, H.265 offers from 25% to 50% better data compression at the same level of video quality, or substantially improved video quality at the same bit rate. It supports resolutions up to 8192×4320, including 8K UHD.
This mean that you should be able to record 20-40% longer period of video with H.265 than H.264 and about 1000% (10x) more than MJPEG. H.265 saves storage space and increase the quality of the video by splitting the frame into adjustable grids compared to H.264 to allow focus ROI (Region of Interest) processing on areas of the screen with activities at a much higher level and accuracy than H.264.
However, H.265 still faces the same patent issues as per H.264 so it’s also not natively supported in some of the browser.