Foscam C1 on Ubuntu issues

Forum for questions and support relating to the 1.30.x releases only.
Locked
AndyMac
Posts: 18
Joined: Thu Sep 15, 2016 11:55 pm

Foscam C1 on Ubuntu issues

Post by AndyMac »

Hi all,

This is my first foray into zoneminder. I'm getting a better camera later next week to try out, but for my first one to try, I have a Foscam C1 webcam that is connected to the network wirelessly.

Install-wise, I do have ffmpeg, libvlc, zoneminder 1.30.0, Ubuntu 14.04, and used the "easy install" guide and the ppa to install zoneminder (though I had to add the database myself which wasn't in that guide) and I complied and added cambozola as well since the logs were complaining about that at one point.

For the camera, I can log in to the camera and see everything just fine there. I set the resolution to 720p, framerate to 3, and keyframes to every 10 (hoping to use this mostly for motion alarms, so I don't need 20fps)

In zoneminder, I've tried both ffmpeg and libvlc and get errors with both. I have the source set to rtsp://user:pass@192.168.1.15:554/videoMain, the method to RTP/RTSP, colorspace to 32 bit colour (also tried 24), width to 1280 and height to 720.

I have no errors showing up in apache2/error.log

ffmpeg, I get
Unable to open input rtsp://user:pass@192.168.1.15:554/videoMain due to: Operation now in progress

Occasionally it says "Analysing at 9.9fps" and "Capturing at 9.9fps". Presumably this is because at this time, I've tried to set the max framerate in ZM to 10 (I've also tried leaving it blank). When I click to see the streaming view, I just get a blue screen.

libvlc, I get a white screen with occasional broken image icons flashing up:
Terminating, last frame sent time 1473984280.129875 secs more than maximum of 10.000000
ERR getStreamCmdResponse stream error: socket_sendto( /tmp/zm/zms-683523s.sock ) failed: No such file or directory - checkStreamForErrors()
ERR socket_sendto( /tmp/zm/zms-683523s.sock ) failed: No such file or directory

So I checked my zoneminder.conf (in conf.d, configuration.available and configuration.enabled)
ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
<Directory "/usr/lib/zoneminder/cgi-bin">
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
AllowOverride All
Require all granted
</Directory>

Alias /zm /usr/share/zoneminder/www
<Directory /usr/share/zoneminder/www>
Require all granted
php_flag register_globals off
Options Indexes FollowSymLinks
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
</Directory>

<Directory /usr/share/zoneminder/www/api>
AllowOverride All
</Directory>

I'm not exactly sure where /tmp/zm is supposed to have been aliased from, but just for fun, I went ahead and created a /tmp/zm/ in my web root

I'm not quite sure where to go from here. Would love some help figuring this out :)
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Foscam C1 on Ubuntu issues

Post by asker »

I have a Foscam C1 and use ffmpeg with it successfully
https://wiki.zoneminder.com/Foscam
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
AndyMac
Posts: 18
Joined: Thu Sep 15, 2016 11:55 pm

Re: Foscam C1 on Ubuntu issues

Post by AndyMac »

Thanks for the reply.

The only difference in that configuration to what I posted was that another site had said to use the port, so I was. I took that off and I get the same result. A big blue window in the streaming area and
"Unable to open input rtsp://<user>:<pass>@192.168.1.15/videoMain due to: Operation now in progress"

There's got to be something else I'm missing somewhere. That's the /only/ error I'm getting ... nothing else in the logs there or in the apache2 logs.

Camera itself displays fine if I view it over its html connection (which I'm not doing while trying to use zoneminder ... in fact, I've rebooted the camera and restarted the web browser after viewing it just to make sure no lingering connections exist).

Edit: Two things have me curious ... is there any way to test the ffmpeg connection outside of zoneminder? I'm wondering 1) what else could possibly be "in progress" ... basically if something else is grabbing the stream? and 2) maybe my ffmpeg distro has an issue (though I doubt it).
AndyMac
Posts: 18
Joined: Thu Sep 15, 2016 11:55 pm

Re: Foscam C1 on Ubuntu issues

Post by AndyMac »

And to add to this, I forced an event from zoneminder to see if any capture data would be available. Both the video and the individual frames of the event (163 frames) were just a large blue screen with timestamps.

So something appears incorrect in capturing the data.

Still nothing in either the apache logs or the zm logs that would indicate a problem. Apache logs are clean, ZM logs just show "Analysing at 9.9 or 10 fps", but apparently they're analyzing a blue screen (no alarming, even when we've walked in front of the camera).

Are there possibly settings on the camera that are wrong? I can't see anything that would matter and the dimensions / framerate appear correct, so not sure what else it could be.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Foscam C1 on Ubuntu issues

Post by bbunge »

"Blue Screen" is usually a configuration issue and likely the resolution is not set to exactly match the camera stream.

General

Source Type: FFmpeg

Source

Source Path: rtsp://<user>:<password>@<ip>/videoMain
Remote Method: RTP/RTSP
Target Colorspace: 32 bit
Capture Width: 1280
Capture Height: 720
Deinterlacing: Disabled

Control

Controllable: No

Also try Capture Width: 640 Capture Height: 360 or 320x180

You may need to force a user of admin with admin rights and not just user rights. If I remember correctly recent Foscam firmware makes you change the default "admin" user because of security issues. This is not a problem if your camera is behind a firewall as it should be...
AndyMac
Posts: 18
Joined: Thu Sep 15, 2016 11:55 pm

Re: Foscam C1 on Ubuntu issues

Post by AndyMac »

Holy goodness this was painful for such a simple solution. Something you said had me going to look for the port info again, and apparently in the camera, you have to turn on "Onvif" to enable RTSP. Turned that on, re-saved the camera info, and boom, 1280x1024 showing clearly in ZM.

On to playing with the ZM settings!

I appreciate the help, and hopefully someone with this problem will be saved my pain in the future :)
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Foscam C1 on Ubuntu issues

Post by bbunge »

You should not have to turn on ONVIF to use RTSP.

Also, I just ran the install @ https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way and the database was created automatically as it should in this release for Ubuntu.
AndyMac
Posts: 18
Joined: Thu Sep 15, 2016 11:55 pm

Re: Foscam C1 on Ubuntu issues

Post by AndyMac »

Don't know what to say ... my C1 didn't have ONVIF turned on, and within ONVIF it lets you set the port for both ONVIF and RTSP ... I made that one single change and it started working.

As to the database, it's possible that was a mistake on my part somewhere. I initially installed zoneminder, but an older version (1.28?), and I couldn't get it to work. I then removed / purged it and /then/ found that same easy install page and tried it. The first errors I was getting were about the database not working, so I went and looked and the database wasn't there. Created it, and all of that started working. But don't know why since I did start "fresh" with all the packages removed and all the directories removed and no extra zoneminder database floating around in there.
Locked