Page 1 of 1
MJPEG vs MPEG for low bandwidth and CPU
Posted: Wed Aug 31, 2011 10:33 am
by TitovLab
Hello!
What is better MJPEG or MPEG for very slow and expensive IP cameras internet connection (56 kbit/s for each camera, traffic is limited) and for low CPU usage on ZoneMinder server (about 200 cameras on one server)?
Re: MJPEG vs MPEG for low bandwidth and CPU
Posted: Wed Aug 31, 2011 12:55 pm
by netwrkr
MPEG.
Re: MJPEG vs MPEG for low bandwidth and CPU
Posted: Thu Sep 01, 2011 6:46 am
by Flasheart
200 cameras on one server, seriously?
MPEG whilst it does use less bandwidth, uses more cpu as it needs to call ffmpeg to convert to jpg before zm touches it. Mjpeg is just a straight frame grab from a stream.
Re: MJPEG vs MPEG for low bandwidth and CPU
Posted: Thu Sep 01, 2011 11:14 am
by mastertheknife
Flasheart wrote:200 cameras on one server, seriously?
MPEG whilst it does use less bandwidth, uses more cpu as it needs to call ffmpeg to convert to jpg before zm touches it. Mjpeg is just a straight frame grab from a stream.
Not entirely true.
For MJPEG, ZoneMinder uses libjpeg (or libjpeg-turbo) to decompress (convert into one of ZM's native formats, e.g. RGB24) the JPEG image. For a MPEG, ZoneMinder uses ffmpeg to extract frames out of the stream, and also for converting these frames into one of ZM's native formats, e.g. RGB24.
mastertheknife
Re: MJPEG vs MPEG for low bandwidth and CPU
Posted: Fri Sep 02, 2011 6:02 am
by Flasheart
Ah, I didn't realise that. Have you done any tests to see which is faster?
Re: MJPEG vs MPEG for low bandwidth and CPU
Posted: Fri Sep 02, 2011 2:03 pm
by netwrkr
concur +mastertheknife.
Switching from MJPG to MPEG/H.264 *significantly* reduces bandwidth and CPU load.
Re: MJPEG vs MPEG for low bandwidth and CPU
Posted: Fri Sep 02, 2011 4:01 pm
by developer123
So what abot H.264 (in comparison to mpeg4) would that be more expensive for the CPU? Or does that not really make a difference?
Re: MJPEG vs MPEG for low bandwidth and CPU
Posted: Fri Sep 02, 2011 8:24 pm
by kingofkya
Mpeg is a container
h.264 is codec
The codec goes inside the container.
Re: MJPEG vs MPEG for low bandwidth and CPU
Posted: Mon Sep 05, 2011 8:33 pm
by gblanco
How to eliminate the delay of the data stream using MPEG? Over time the data stream is getting late. Sometimes reaches more than 1 minute late. MJPEG is practically in real time.
Re: MJPEG vs MPEG for low bandwidth and CPU
Posted: Tue Sep 06, 2011 1:50 pm
by mastertheknife
gblanco wrote:How to eliminate the delay of the data stream using MPEG? Over time the data stream is getting late. Sometimes reaches more than 1 minute late. MJPEG is practically in real time.
Don't limit the fps.
mastertheknife
Re: MJPEG vs MPEG for low bandwidth and CPU
Posted: Thu Sep 08, 2011 5:11 pm
by gblanco
mastertheknife wrote:gblanco wrote:How to eliminate the delay of the data stream using MPEG? Over time the data stream is getting late. Sometimes reaches more than 1 minute late. MJPEG is practically in real time.
Don't limit the fps.
mastertheknife
I use NORMAL CAMERAS (NOT IP)... The data stream is not in real time after a while. It seems to me that there is a buffer.
Using JPEG (firefox streaming or camboloza streaming in Internet Explorer) streaming works great(sometime discard one or two seconds) but using mpeg streaming after while get totally late.
Re: MJPEG vs MPEG for low bandwidth and CPU
Posted: Mon Sep 12, 2011 12:59 pm
by gblanco
gblanco wrote:mastertheknife wrote:gblanco wrote:How to eliminate the delay of the data stream using MPEG? Over time the data stream is getting late. Sometimes reaches more than 1 minute late. MJPEG is practically in real time.
Don't limit the fps.
mastertheknife
I use NORMAL CAMERAS (NOT IP)... The data stream is not in real time after a while. It seems to me that there is a buffer.
Using JPEG (firefox streaming or camboloza streaming in Internet Explorer) streaming works great(sometime discard one or two seconds) but using mpeg streaming after while get totally late.
???
Re: MJPEG vs MPEG for low bandwidth and CPU
Posted: Thu Dec 22, 2011 7:11 am
by carteriii
mastertheknife wrote:Don't limit the fps.
mastertheknife
mastertheknife, would you please elaborate on this statement?
I've always assumed that lowering the fps would help ZoneMinder and reduce the changes of big gaps in my recordings. I think this still makes sense for use with a capture card or with simple jpeg images or even mjpeg, but now I'm wondering if my assumption has been just wrong with mpeg streams. Am I actually creating more work, and risking more lag, by setting Max FPS to just 2-3fps with ZoneMinder? Does a low fps require extra work to "catch up"?
Thank you.
Re: MJPEG vs MPEG for low bandwidth and CPU
Posted: Thu Dec 22, 2011 9:46 am
by mastertheknife
carteriii wrote:mastertheknife wrote:Don't limit the fps.
mastertheknife
mastertheknife, would you please elaborate on this statement?
I've always assumed that lowering the fps would help ZoneMinder and reduce the changes of big gaps in my recordings. I think this still makes sense for use with a capture card or with simple jpeg images or even mjpeg, but now I'm wondering if my assumption has been just wrong with mpeg streams. Am I actually creating more work, and risking more lag, by setting Max FPS to just 2-3fps with ZoneMinder? Does a low fps require extra work to "catch up"?
Thank you.
When i advised not to limit the fps, i thought the user was using an IP camera. The problem with a MJPEG stream from an IP camera is that the receiver has no way to control the frame rate, so the only option to reduce the frame rate is to skip certain frames, but at the moment, ZM doesn't do this and by limiting your frame rate, you will actually get a constantly increasing delay.
Some cameras have an option to specify the maximum frame rate, e.g. maxfps=5 in the URL. If your camera supports that, thats what you should use.
mastertheknife