Using the new V4L2 support versus mjpeg-streamer

Forum for questions and support relating to the 1.24.x releases only.
Locked
User avatar
Blazer
Posts: 234
Joined: Sun Jun 05, 2005 12:57 pm

Using the new V4L2 support versus mjpeg-streamer

Post by Blazer »

Some people have suggested that it is better to use mjpeg-streamer rather than the new V4L2 support, since mjpeg-streamer only uses 1-2% CPU, and using native support in ZM would probably use more.

Has anyone actually tried this and compared CPU usage?

I have hit a brick wall with mjpeg-streamer as far as quality. Here is the issue. By default, mjpeg-streamer uses MJPEG mode, at 80% image quality. If you change the quality settings to anything (even to the same value, as in -q 80), mjpeg-streamer forces the mode to switch from MJPEG to YUV mode, which uses a TON of CPU. How much CPU? Check this out. This is two instances of mjpeg-streamer. One is using the default settings, the other is using "-q 80" for the input_uvc plugin:

Code: Select all

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
19070 root 20 0 26280 3932 3128 S 40.7 0.2 0:04.92 mjpg_streamer 
14653 root 20 0 46852 1832 1536 S 1.9 0.1 21:17.89 mjpg_streamer
As you can see, using the same jpeg quality setting (80), but in YUV mode (which you cannot override), is using 40% CPU compared to 1.9%!

So I guess where I am going with this, is I am wondering if ZM 1.24.x using native V4L2 mode on a UVC camera would allow setting the quality to greater than 80% and not go crazy with CPU usage!

Of course I have a reason for all of this...I have an application using Logitech Quickcam Pro 9000 units, and due to the image quality white objects at a distance are being washed out and losing details. After much twiddling with white balance settings and resolutions, I discovered that simply increasing the jpeg resolution fixed the problem, but then I am smacked by the CPU issue. With 6 cameras on a machine, having each of them using 40% CPU, before ZM is even running, is simply not an option! I have posted on the mjpeg-streamer forum on sourceforge explaining this issue as well.
newvisionantenna
Posts: 381
Joined: Sat Jan 17, 2009 7:49 pm
Location: Germany

Post by newvisionantenna »

I use mjpg_streamer on devices with 200mhz processor's and 32mb or less ram. I've had two feeds going on one device both running at 640x480 or greater with little to no cpu usage, 15+ fps, and excellent picture. These devices are all providing streams remotely so I can't comment yet on running mjpg_streamer on the actual server. Is that what your doing? Are you saying running mjpg_streamer on the actual Zoneminder server is giving you problems?

You should grab some NSLU2's or some ASUS routers, I'll hook you up :)
User avatar
Blazer
Posts: 234
Joined: Sun Jun 05, 2005 12:57 pm

Post by Blazer »

I think you completely missed my point.

using the -q option with mjpeg-streamer forces it to use YUV mode, which uses tons of CPU.

I'm looking for alternatives, because I have an application which requires more than the default 80% jpeg quality. Using ZM 1.24.x new V4L2 support to stream directly from the device instead of using mjpeg-streamer may be an option.
Locked