Help configuring mjpg_streamer, please

Support and queries relating to all previous versions of ZoneMinder
Locked
MikeH
Posts: 23
Joined: Tue Jul 22, 2008 5:16 pm
Location: UK

Help configuring mjpg_streamer, please

Post by MikeH »

I'm trying to get a Logitech Quickcam Pro 9000 working. It seems to be getting closer, but I'm confused as to how to set-up mjpg_streamer.

The camera is v4l2 compatible and is correctly recognised by my Ubuntu 8.04 system. It works with Ekiga and Luvcview.

I've installed Zoneminder 1.22.3 from the Ubuntu repositories. Apache and MySQL were already on my system.

If I run mjpg_streamer I get the following:-

Code: Select all

mike@HomePC:~$ mjpg_streamer
MJPG Streamer Version.: 2.0
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 5
 i: Format............: MJPEG
 o: www-folder-path...: disabled
 o: HTTP TCP port.....: 8080
 o: username:password.: disabled
 o: commands..........: enabled
If I then browse to http://localhost:8080 I get a message that says:-

Code: Select all

501: Not Implemented!
no www-folder configured
I see that mjpg_streamer is saying that "www-folder-path" is disabled. Presumably there's a connection to the error that my browser is reporting?

I couldn't find any documentation on the configuration options supported by mjpg_streamer. Is there any, or can someone let me know how I should configure the www-folder-path?

Finally, are there any configuration changes I need to make to Apache and MySQL?

Thanks,

Mike
mattneighbour
Posts: 6
Joined: Wed Aug 06, 2008 8:18 pm

Post by mattneighbour »

Hi,

You need to add the 'folder'

so you actually go to

http://localhost:8080/?action=snapshot

Hope that works - it did for me, I've spent 3 days getting ZM to work with my Quickcam Ultra Vision. The snapshot parameter takes a single jpeg, I couldn't get Firefox to do streaming. VLC media player worked though, if you have it point it to http://localhost:8080/?action=stream.

Regards,

Matt

(off to post a Q about the next problem... :roll: )
MikeH
Posts: 23
Joined: Tue Jul 22, 2008 5:16 pm
Location: UK

Post by MikeH »

Ah thanks! That works - or at least the snapshot did. Firefox produces a non-blank screen when attempting to view a stream, but not a recognisable picture. I'll investigate further tomorrow.

So where is the 'action=snapshot/stream' stuff defined. Is there any documentation for this - short of taking a look at the source? :)
MikeH
Posts: 23
Joined: Tue Jul 22, 2008 5:16 pm
Location: UK

Post by MikeH »

I've had another play with this and, yes, Firefox works with snapshots but not streams. I'm using Firefox version 3.0.1.

In trying to get a stream to work, I found that by specifying a resolution of 320x240 and a frame rate of 5 fps it would then display a static picture rather than the mush I had seen last night, but still just a single frame. VLC works fine.

Time to try configuring Zoneminder.
MikeH
Posts: 23
Joined: Tue Jul 22, 2008 5:16 pm
Location: UK

Post by MikeH »

It works! :shock:

I have Zoneminder working with my Logitech Quickcam Pro 9000 webcam and it's displaying a good quality picture and detecting events. Unlike some other webcams I've tried, it works well in low light or in full daylight.

Image

It was all relatively easy once I'd overcome a few hurdles and the odd bit of misleading information... I spent ages trying to get xawtv working with my webcam because the documentation implies that a working xawtv is a pre-requisite for a working Zoneminder. Not true! I couldn't get xawtv to work at all. I may have misunderstood something here, so please correct me if I'm wrong, but a working xawtv is irrelevant if you use a v4l2 device and therefore have to use mjpg_streamer. Until v4l2 is natively supported in a future release of Zoneminder, using something like mjpg_streamer is the only option.

Once I'd understood that and been pointed towards using the correct url to view the output http://localhost:8080/?action=stream then I could see it was working. From there, setting up a basic working configuration in Zoneminder was relatively easy.

I nearly gave up a couple of times. It's taken me several days of searching and reading, getting an understanding of the vagaries of uvc, v4l, v4l2, etc. Only then could I be reasonably confident that the webcam I had bought would work.

This is a useful document on linux supported uvc devices:-

http://linux-uvc.berlios.de/#devices

This document (and the Excel/PDF document it refers to) is useful if you are considering a Logitech webcam.:-

http://www.quickcamteam.net/hcl/linux/logitech-webcams

In the case of the Pro 9000 it turns out that there are lots of sub-models some of which have bugs while some are problem-free. Fortunately the part number of mine (the part number is only printed on the paper tag that's attached to the cable near the usb connector) showed mine to be one of the problem-free sub-models - a 861-464-0000.
pcapazzi
Posts: 2
Joined: Fri Aug 22, 2008 12:57 am

Post by pcapazzi »

Could you detail some of the configuration options you set to get this working?

I can see the mjpg-streamer in my browser as is. but I must be missing something on the zoneminder side, or perhaps i'm missing a library.

I'm using 8.04 Ubuntu. I recently installed ffmpeg and set the zm option to use it. mpeg_encoder doesn't appear to be supported by Ubuntu so I'm not installing that. I also enabled the 'use network source' option in the general options tab.

When I view the camera page I see either a missing image icon (before ffmpeg) or a large image icon (after selecting ffmpeg).

I'm using a Dell XPS laptop with built in video. Again, I can see a stream from mpeg-streamer so that appears to function.

Monitor1 settings:
Remote
local
8080
/?action=stream
640
480
24-bit color

Changes in general options:
under images:
Stream method mpeg
chose ffmpeg as the opt_mpeg option
updated the path to ffmpeg and confirmed it
Network tab:
Are you going to use remote/network cameras - yes

Any help would be appreciated.
MikeH
Posts: 23
Joined: Tue Jul 22, 2008 5:16 pm
Location: UK

Post by MikeH »

I just installed Zoneminder from the repos and I haven't added anything else except to install mjpg_streamer. I haven't done anything with ffmpeg at all...

Three things...

First you implied that your Remote Host Name is set to 'local'. It needs to be localhost, but I suspect that was just a typo in your post rather than a real entry on your webcam configuration?

Second, the Source Type (in the General tab) needs to be set to 'remote' - is that what you currently have set as 'local'? If so, that may be your problem.

Third, I see you have the resolution set to 640x480. I had mine working at 320x240 and 5 fps. Try that before you move on to testing faster frame rates and higher resolutions. I don't know if it's necessary, but I always set the same resolution and frame-rate in mjpg_streamer as I have in the monitor configuration for Zoneminder.

Possibly significantly, I haven't managed to get 640x480 working yet - I'm getting a blank box with 'webcam' in the corner - although 'monitor' and 'localhost' are both yellow. It also works at that higher resolution with VLC, so it's a Zoneminder issue that I have yet to sort out. I was just about to trawl the Zoneminder forum to look for ideas when I came across your post. :)

Let me know if you get yours working at 640x480!
MikeH
Posts: 23
Joined: Tue Jul 22, 2008 5:16 pm
Location: UK

Post by MikeH »

A small update since my last post...

I'm pretty sure that the reason mine is working at 320x240 but not at 640x480 is that common problem of insufficient shared memory.

In syslog I'm getting lots of messages like this:-

Code: Select all

Aug 23 19:22:24 HomePC zmu[25768]: ERR [Can't shmget, probably not enough shared memory space free: Invalid argument]
So a quick change to the shared memory settings should fix it... but I have other things to do now, so it will have to be a job for tomorrow.
MikeH
Posts: 23
Joined: Tue Jul 22, 2008 5:16 pm
Location: UK

Post by MikeH »

Just for the record, I didn't need to change any shared memory settings. The default of 134217728 for both shmall and shmmax was fine for my system.

The problem seems to have arisen because I was changing resolution settings without re-booting or using the ipcrm command to clear-up.
subzero3579
Posts: 2
Joined: Thu Feb 12, 2009 4:06 pm
Location: Malaysia

Post by subzero3579 »

I follow this thread and finally get my Zoneminder working.First I used this Sirius USB2.0 webcam from Z-Star Microelectronics, but will stuck with usual. China made.Price is MYR 35.00

"Unable to set format: Invalid argument
Init v4L2 failed !! exit fatal
"i: init_VideoIn failed

This camera works with Cheese at 640x480.
After 3 days i finally gave up, and when to get the cheapest Logitech I can find with QuickcamTeam listed compatible webcam
Logitech Quickcam E3500 Plus. Price is MYR 85.00
Works with Cheese at same 640x480
i run mjpg_streamer, then localhost:/?action=stream, working.
Also works in Zoneminder at 640x480 at 5 fps.

:D
allankliu
Posts: 2
Joined: Tue Feb 17, 2009 7:39 am

I can not get the mjpeg working yet

Post by allankliu »

http://www.zoneminder.com/forums/viewtopic.php?t=13116

I follow the discussion, however I can not get it working. Although it works for http://127.0.0.1:8080/?action=stream with m-jpeg.

My setup of ZM:

General:
Name:IPCam
Source Type: Remote
Function: Monitor
Enabled: checked
Linked Monitors: 3(IPCam)
Max FPS: 2
Alarm Max FPS: blank
Reference Image Blend %: 7

Source:
Remote Host Name: 127.0.0.1
Remote Host Port: 8080
Remote Host Path: /?action=stream
Remote Image Colours: 24 bit colour
Capture Width: 640
Capture Height: 480
Orientation: Normal

Maybe I will try to adjust both mjpeg and zm to QVGA first. If not, I have the only way out, replace the camera with Logitech camera.
nausser
Posts: 18
Joined: Sat Oct 09, 2010 9:08 pm
Location: South Florida

Also no luck with 640x480

Post by nausser »

I am having a similar problem getting my logitech webcam to work it 640x480. I can see that mjpg_streamer works fine in that resolution since I can navigate to http://localhost:8080/?action=stream. I've tried doing a full restart after changing the streamer and zm to the higher resolution, all with no luck.

The only thing I haven't tried is expanding my memory. I don't know how to do this but I've read about people doing that in these forums.

This thread is the most closely related so I just wanted an update from anyone else that has had this issue and resolved it.

Thanks.


UPDATE:

Please see the following for my solution:

http://www.zoneminder.com/forums/viewto ... 5070#65070
Time never ceases to accelerate.
Locked