Zoneminder streaming for Foscam fi8921w

Forum for questions and support relating to the 1.27.x releases only.
dodtsair
Posts: 31
Joined: Sun Nov 10, 2013 4:51 am

Zoneminder streaming for Foscam fi8921w

Post by dodtsair »

What configurations are you guys using to connect to a foscam fi8921w?


I can connect my camera using vlc and the following settings:
rtsp://192.168.1.38:80/videoMain
User: admin
Password: password

But when I try the same settings with ffmpeg I get the follow error in the log:
Unable to open input rtsp://admin:cgt22py2Xq2@192.168.1.38:80/videoMain due to: Operation now in progress


I had upgraded to zoneminder 1.27 on ubuntu 13.10 because I was under the impression that i fixed ffmpeg smearing issues. When I change to the libvlc type there are no errors, but I still see no video.

In both cases this warning repeats in the log file:
Waiting for capture daemon

I see other people are successful with the 8921w, so I don't know what is wrong with my setup.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder streaming for Foscam fi8921w

Post by knight-of-ni »

http://www.zoneminder.com/forums/viewto ... =9&t=21266

If you have your system set up properly, libvlc should be a drop in replacement for ffmpeg. All you should have to is change the method.

Note that Zoneminder does not yet officially support Ubuntu 13.10, despite claims of success by a few others. We are working on it and plan to get something released in time for the next LTS release.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
dodtsair
Posts: 31
Joined: Sun Nov 10, 2013 4:51 am

Re: Zoneminder streaming for Foscam fi8921w

Post by dodtsair »

I guess my issues are due to 1.27 on ubuntu 13.10.

I can use the following command to download and save a stream from the camera:

cvlc --rtsp-user admin --rtsp-pwd password 'rtsp://192.168.1.38:80/videoMain' --sout="#std{access=file,mux=ps,dst=go.mpg}"

I can then view the stream in vlc and see the camera's view. But when I use this configuration with zoneminder I get silence. No errors in the log. Looking at the capture I just get a broken page.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder streaming for Foscam fi8921w

Post by knight-of-ni »

Using Ubuntu 13.10 is going to make things more difficult, but technically not impossible.

Did you follow the steps for setting up your camera in the link I provided?
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
dodtsair
Posts: 31
Joined: Sun Nov 10, 2013 4:51 am

Re: Zoneminder streaming for Foscam fi8921w

Post by dodtsair »

Yes I looked over that forum post, I have seen it before. I used it as a basis to configure my camera correctly.

I spent the day reinstalling the OS. I am now running ubuntu 12.04 and zoneminder 1.27.

Now FFMPEG works great, but libvlc still has the same problem. The feed still has no image.
http://www.dodtsair.com/images/libvlc-error.png

I see these errors in the log when I am displaying the feed:
getStreamCmdResponse stream error: socket_sendto( /tmp/zm/zms-024894s.sock ) failed: No such file or directory - checkStreamForErrors()
socket_sendto( /tmp/zm/zms-024894s.sock ) failed: No such file or directory
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder streaming for Foscam fi8921w

Post by knight-of-ni »

With ffmpeg/libvlc sources, sometimes I get the symptoms you describe if I open it too quickly after saving the monitor.
It might take a minute (literally).

Other times your symptoms mean you've got an Apache config problem, but that would affect all cameras.

Lastly, I would double check to make sure you've got all the right liblvc libraries installed. There are multiple and the package names vary by distro.

On another note, you didn't say how you installed zoneminder, but did you know you can just add iconnor's PPA and install from package?
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
dodtsair
Posts: 31
Joined: Sun Nov 10, 2013 4:51 am

Re: Zoneminder streaming for Foscam fi8921w

Post by dodtsair »

I installed using iconnor's PPA. The only difference is that I converted the apache server to support named virtual hosts and then made a named virtual host for zoneminder. I'll take a look at the libvlc package list. I'll also reset the zoneminder apache configuration and use the config that comes out of the box for zoneminder.

I did install libvlc-nox I thought that would give me everything I needed... maybe not.

I also installed some of these, I forgot which: "libvlc-dev libvlc5 libvlccore-dev libvlccore5 vlc-data"

I set the server aside for the moment because it was frustrating me so much.
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Zoneminder streaming for Foscam fi8921w

Post by bbunge »

Am successfully running this camera for several months. Recently did a firmware upgrade and had to go back to "adjust" some settings.

Source Path: rtsp://admin:password@192.168.1.244:80/videoMain

Of course use your user and password.

Capture Width 320 Capture Height 180 (or multiples thereof)
On the Control tab select the Foscam FI9821W Type. In Control enter the camera admin password and in the Control Address the IP of the camera.

Back to the camera in the video settings for Video Main: Frame Rate 10 Key Interval 10 (turn them higher if you want to but you will likely get smeary images!). You may want to turn some of the other settings to a lower value as well. Get it working then push things higher to see what works best for you.

bb
dodtsair
Posts: 31
Joined: Sun Nov 10, 2013 4:51 am

Re: Zoneminder streaming for Foscam fi8921w

Post by dodtsair »

what packages need to be installed on ubuntu for libvlc to work? I am not sure I have all the right packages installed?
dodtsair
Posts: 31
Joined: Sun Nov 10, 2013 4:51 am

Re: Zoneminder streaming for Foscam fi8921w

Post by dodtsair »

I cannot seem to get control to work for this either.

Controllable: tick
Control Type: Foscam FI8921W
Control Device: admin
Control Address: 192.168.1.38
Auto Stop Timeout: 0.00
Track Motion: unticked
Return Location: none
Return Delay: 0
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Zoneminder streaming for Foscam fi8921w

Post by knight-of-ni »

dodtsair wrote:I cannot seem to get control to work for this either.

Controllable: tick
Control Type: Foscam FI8921W
Control Device: admin
Control Address: 192.168.1.38
Auto Stop Timeout: 0.00
Track Motion: unticked
Return Location: none
Return Delay: 0
In the link I provided, see how the auto stop timeout is 0.7 and not 0?
My memory is fuzzy on this, but I think you have to put a non-zero value in there.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Zoneminder streaming for Foscam fi8921w

Post by bbunge »

You need to use your admin password in Control Device

See: http://www.zoneminder.com/forums/viewto ... 31&t=22109
dodtsair
Posts: 31
Joined: Sun Nov 10, 2013 4:51 am

Re: Zoneminder streaming for Foscam fi8921w

Post by dodtsair »

That helped me get control up and working which is nice. libvlc still does not work. I remember ffmpeg working well, but not works sometimes most of the time it doesn't work. If I keep reloading the zm camera's page eventually I get a video stream.

The other camera dcs-5020l is fine, but I can't control the pan and tilt.
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Zoneminder streaming for Foscam fi8921w

Post by bbunge »

I've not been able to get libvlc working with this camera.
Here is my post about this camera:
General Tab
Source Type Ffmpeg

Source Tab
Source Path: rtsp://admin:password@192.168.1.244:80/videoMain (Of course use your user and password and your camera IP address)

Capture Width 320 Capture Height 180 (or multiples thereof)

Control Tab
Type Foscam FI9821W
Control Device enter the camera admin password
Control Address the IP of the camera.

Back to the camera setup utility: in the video settings for Video Main: Stream Type 0 Resolution 720 Frame Rate 10 Key Interval 10 (turn them higher if you want to but you will likely get smeary images!). You may want to turn some of the other settings to a lower value as well. Get it working then push things higher to see what works best for you.

As for the pan-tilt, I maneuvered the camera with the camera web utility until I got the view I wanted then set the preset in ZM. Did this for left-center-right views. It is possible to do a bunch more!
dodtsair
Posts: 31
Joined: Sun Nov 10, 2013 4:51 am

Re: Zoneminder streaming for Foscam fi8921w

Post by dodtsair »

Unfortunately for me this camera requires a browser plugin. That plugin has never worked for me. Apart from zoneminder I cannot see video or do pan + tilt. With zoneminder sometimes ffmpeg will give me video often times it wont. I was able to get pan tilt working.


Here are the errors I think that ffmpeg is producing:
Apr 6 17:23:19 petros zmc_m1[9327]: FAT [Unable to decode frame at frame 6]
Apr 6 17:23:19 petros zmdc[9012]: ERR ['zmc -m 1' exited abnormally, exit status 255]
Apr 6 17:23:33 petros zmwatch[9074]: INF [Restarting capture daemon for fi9821w, time since last capture 14 seconds (1396830213-1396830199)]
Apr 6 17:23:33 petros zmdc[9012]: INF ['zmc -m 1' starting at 14/04/06 17:23:33, pid = 9337]
Apr 6 17:23:33 petros zmdc[9337]: INF ['zmc -m 1' started at 14/04/06 17:23:33]
Apr 6 17:23:33 petros zmc_m1[9337]: INF [Starting Capture]
Apr 6 17:23:33 petros zmc_m1[9337]: INF [Priming capture from rtsp://admin:cgt22py2Xq2c@192.168.1.38:80/videoMain]
Apr 6 17:23:39 petros zmc_m1[9337]: FAT [Unable to decode frame at frame 8]
Apr 6 17:23:39 petros zmdc[9012]: ERR ['zmc -m 1' exited abnormally, exit status 255]
Apr 6 17:23:53 petros zmwatch[9074]: INF [Restarting capture daemon for fi9821w, time since last capture 14 seconds (1396830233-1396830219)]
Locked