Size / Compression of MJPEG vs MPEG-4

Toby picture Toby · Jan 30, 2012 · Viewed 15.8k times · Source

how big is the difference between a MJPEG and a MPEG-4 encoded stream ? I have an IP Camera which is capable of saving data to a 32 MB Buffer, in MJPEG Format or in MPEG-4. Resolution is 800x600 at 30 FPS Now when I streamed with MJPEG I could save like a 40-50 seconds. When streamed with MPEG-4 I could save 8 minutes ( if there was almost no motion ) and like 3 minutes if there was a lot of motion.

I know that the size of the MPEG-4 depends on how much motion / changes there were but what I am wondering about is the fact that even with full motion the MPEG-4 can save so much more video than MJPEG ? Is the compression of MJPEG really "that bad" ?

Answer

Roman R. picture Roman R. · Jan 30, 2012

M-JPEG is not really bad, it is awesome instead. The encoding is widely supported, each individual frame can be decoded without references to other stream data. Yes, the compression rates are not as efficient as those of achievable with MPEG-4.

There is often an option to set MPEG-4 streams to match desired bitrate (CBR encodings) which is a good way to control bandwidth and actual bitrates. It is a rare option with JPEG encoding.

Check this out: MJPEG vs. H.264 with video surveillance cameras (which itself refers to another interesting reading Why we like MJPEG compression).