Page 1 of 1

Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Mon Sep 14, 2015 5:58 pm
by ldenneau
Hi,

I'm trying to run ZoneMinder v1.28.1 on a very basic setup: a fresh install of Ubuntu 14.04 and a single Foscam FI8918W connected over ethernet. ZM is installed from Isaac Connor's PPA. The webcam works fine, I can use its web-based interface without problems. After I set up the camera in ZM, it appears to connect to the camera but cannot create JPEG images. All configuration in ZM is using the defaults. The logs contain:

Unable to decode jpeg
Failed requesting writeable buffer for reading JPEG image.
Held buffer is undersized for requested buffer

The URL in the camera setup (/snapshot.cgi?user=alice&pwd=secret) works fine when using a web browser.

I suspect there is an issue with how shared memory is being handled. Anybody know how to fix this?

Thanks,
Larry

Re: Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Mon Sep 14, 2015 6:40 pm
by asker
Before we debug other aspects, can you try the following instead of snapshot.cgi


General Tab:
Source Type: FFMpeg

Source Tab:
Source Path:
http://camip/videostream.cgi?user=xxx&pwd=yyy (replace xxx/yyy/camip)

Remote Method:
RTP/RTP/HTTP

colorspace: 24bit

Width/Height:640x480

Re: Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Mon Sep 14, 2015 7:50 pm
by knight-of-ni
Please follow the programming documentation for this camera here:
http://www.zoneminder.com/wiki/index.php/Foscam_FI8918W

Re: Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Mon Sep 14, 2015 9:28 pm
by ldenneau
When I change the URL to videostream.cgi, ZM appears to connect to the webcam, but the monitor doesn't display any images. The logs say

getStreamCmdResponse stream error: socket_sendto( /var/run/zm/zms-085101s.sock ) failed: No such file or directory - checkStreamForErrors() socket_sendto( /var/run/zm/zms-085101s.sock ) failed: No such file or directory
atlas-lab: 46000 - Capturing at 1000.00 fps
atlas-lab: 45000 - Capturing at 1000.00 fps

I tried following the instructions on the page that knnniggett posted, but when I add a new monitor I do not see a "Control" tab, only General/Source/Timestamp/Buffers/Misc.

Thanks,
Larry

Re: Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Mon Sep 14, 2015 11:48 pm
by knight-of-ni
Ignore this for now, until we fix the other message:
ldenneau wrote: getStreamCmdResponse stream error: socket_sendto( /var/run/zm/zms-085101s.sock ) failed: No such file or directory - checkStreamForErrors() socket_sendto( /var/run/zm/zms-085101s.sock ) failed: No such file or directory
This means your backend is not working. Make sure you are not accessing the camera's web page at the same time you are trying to view it in ZoneMinder. Try the test again, and wait a little longer. Do not try to view the monitor in ZoneMinder and just watch the logs. You are looking for "Capturing at x.xx fps" where x.xx matches the frame rate in your camera, or a new error message appears.

Also, use something like VLC to verify the url you are using in zoneminder.
ldenneau wrote: atlas-lab: 46000 - Capturing at 1000.00 fps
atlas-lab: 45000 - Capturing at 1000.00 fps
You have to turn on PTZ control under Options first before the tab will appear.
ldenneau wrote: I tried following the instructions on the page that knnniggett posted, but when I add a new monitor I do not see a "Control" tab, only General/Source/Timestamp/Buffers/Misc.

Re: Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Tue Sep 15, 2015 12:09 am
by bbunge
Please review these instructions to see if you skipped something in your setup:

http://www.zoneminder.com/wiki/index.ph ... e_easy_way

For your monitor:
Source Type: Remote
Function: (your choice but start with Monitor)
Remote Protocol: HTTP
Remote Method: Simple
Remote Host Name: (camera IP)
Remote Host Port: 80
Remote Host Path: /videostream.cgi?user=admin&pwd=(password)&rate=11
Capture Width: 320
Capture Height: 240

I have two of these cameras running with these settings. The &rate=11 will give you 5 FPS.

Control gets a bit complicated. Get the video to work then attack control from the procedure in this forum.

Re: Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Tue Sep 15, 2015 12:15 am
by ldenneau
bbunge wrote:Please review these instructions to see if you skipped something in your setup:

http://www.zoneminder.com/wiki/index.ph ... e_easy_way

For your monitor:
Source Type: Remote
Function: (your choice but start with Monitor)
Remote Protocol: HTTP
Remote Method: Simple
Remote Host Name: (camera IP)
Remote Host Port: 80
Remote Host Path: /videostream.cgi?user=admin&pwd=(password)&rate=11
Capture Width: 320
Capture Height: 240

I have two of these cameras running with these settings. The &rate=11 will give you 5 FPS.

Control gets a bit complicated. Get the video to work then attack control from the procedure in this forum.
I tried this originally, except using snapshot.cgi. If I use videostream.cgi, I get the same errors that I mentioned at the beginning of this thread ("unable to decode JPEG"). The webcam works fine through a web browser and VLC.

I don't care about control at this point; I'd just like to see the images in the ZM monitor.

Re: Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Tue Sep 15, 2015 1:01 pm
by bbunge
Did you review the install instructions? You may want to start over with a fresh install of Ubuntu server or try another camera. Also make sure you are using the correct port that your camera uses. I set my cameras to use port 80 but yours may use port 88 (Foscam default for some cameras).

Re: Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Tue Sep 15, 2015 7:31 pm
by ldenneau
bbunge wrote:Did you review the install instructions? You may want to start over with a fresh install of Ubuntu server or try another camera. Also make sure you are using the correct port that your camera uses. I set my cameras to use port 80 but yours may use port 88 (Foscam default for some cameras).
ZM is installed on a fresh Ubuntu 14.04 install already. I've gone through about three different sets of install instructions, all slightly different. None of them produce a working ZM. This is about the most basic setup I can imagine.

I've deployed about a half-dozen of these cameras in a remote telescope environment. We are able to operate them over the web or with VLC through SSH tunnels. I know how to set them up. I am simply trying to get ZM running on a dedicated Ubuntu 14.04 computer talking to a FI8918W in my office so that we can do some security monitoring.

Thanks,
Larry

Re: Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Tue Sep 15, 2015 7:54 pm
by asker
Okay, I have the same camera. So let's see if I can help.

Questions (not all of them may be directly relevant to your problem)

1. Launch a terminal and let me know the output of

Code: Select all

df -h
2. Please post a screenshot of how you have configured the camera in ZM - please post an image of the General/Source/Buffers tabs

3. What sort of a server specs are you running ZM on? What is the average load?

Re: Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Wed Sep 16, 2015 1:31 am
by bbunge
Hmm...

I periodically check my install procedure to make sure someone has not changed it and that it still works! I went through the install for 1.28.1 on 14.04-3 a week ago and it was OK...

So, start with a fresh Ubuntu server install and just install LAMP from tasksel.

Next follow the install steps beginning with Enable CGI in Apache2 from this web page in the ZM WIKI:

http://www.zoneminder.com/wiki/index.ph ... e_easy_way

You do not have to make the changes to MySQL or add cambozola

Think I may have given you the setup for a FI9810W camera. It should be the same as the "18" and if you can get it to work in VLC use the same info in ZM and use Ffmpeg. You could try Libvlc but I've not had much success with it.

asker likely has the best info on the camera...

Oh...if you do not get the HxW settings right your video will never work.

bb

Re: Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Fri Sep 18, 2015 1:50 am
by ldenneau
I reinstalled Ubuntu 14.04 server 64-bit and followed bbunge's install instructions to the letter. So it's a totally virgin system, no disk used, no extra processes, and same results. When using SourceType=Remote/Method=Simple/snapshot.cgi, the log messages say

Code: Select all

Unable to decode jpeg
Failed requesting writeable buffer for reading JPEG image.
Held buffer is undersized for requested buffer
over and over. When I using SourceType=Ffmpeg/videostream.cgi?rate=11, I see alot of

Code: Select all

lab: 39000 - Capturing at 1000.00 fps
Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results for monitor lab
If I bring up the monitor I see a blue screen with running time at the top left.

The system is a modern LogicSupply industrial computer with 2 1GHz Celeron cores, 4GB RAM, 60GB SSD. This computer ran an astronomical telescope flawlessly for about a year, so the computer is fine. The Foscam webcam works fine over HTTP or VLC.

Code: Select all

$ df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/merch--vg-root   54G  2.5G   49G   5% /
none                        4.0K     0  4.0K   0% /sys/fs/cgroup
udev                        1.9G   12K  1.9G   1% /dev
tmpfs                       389M  560K  388M   1% /run
none                        5.0M     0  5.0M   0% /run/lock
none                        1.9G   22M  1.9G   2% /run/shm
none                        100M     0  100M   0% /run/user
/dev/sda2                   237M   80M  145M  36% /boot
/dev/sda1                   511M  3.4M  508M   1% /boot/efi
$ w
 15:36:31 up 2 days,  2:27,  2 users,  load average: 1.19, 0.96, 0.47
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
atlas    tty1                      Tue13    2days  0.14s  0.11s -bash
atlas    pts/0    cadeo.ifa.hawaii 15:35    7.00s  0.11s  0.00s w
$ top -b -n 1 | head -30
top - 15:49:09 up 2 days,  2:40,  2 users,  load average: 1.10, 1.00, 0.76
Tasks: 113 total,   2 running, 111 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.7 us,  0.3 sy,  0.0 ni, 98.8 id,  0.1 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:   3974600 total,  2719668 used,  1254932 free,   209188 buffers
KiB Swap:  4116476 total,        0 used,  4116476 free.  2045144 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
  565 www-data  20   0  351452  23708  15540 R 102.4  0.6   0:36.35 zmc
    1 root      20   0   36548   5876   1544 S   0.0  0.1   0:34.79 init
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kthreadd
    3 root      20   0       0      0      0 S   0.0  0.0   0:00.89 ksoftirqd/0
    4 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0
    5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0H
    7 root      20   0       0      0      0 S   0.0  0.0   0:16.10 rcu_sched
    8 root      20   0       0      0      0 S   0.0  0.0   0:14.47 rcuos/0
    9 root      20   0       0      0      0 S   0.0  0.0   0:17.65 rcuos/1
   10 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_bh
   11 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/0
   12 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcuob/1
   13 root      rt   0       0      0      0 S   0.0  0.0   0:00.51 migration/0
   14 root      rt   0       0      0      0 S   0.0  0.0   0:01.51 watchdog/0
   15 root      rt   0       0      0      0 S   0.0  0.0   0:01.51 watchdog/1
   16 root      rt   0       0      0      0 S   0.0  0.0   0:00.59 migration/1
   17 root      20   0       0      0      0 S   0.0  0.0   0:00.51 ksoftirqd/1
   19 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/1:0H
   20 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 khelper
   21 root      20   0       0      0      0 S   0.0  0.0   0:01.79 kdevtmpfs
   22 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 netns
   23 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 writeback
   24 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kintegrityd
The ZM board won't let me attach a file, so I put screenshots of the monitor settings here: http://goo.gl/Y03INZ

Thanks for your help folks. I'd dig into the source code myself to debug but I simply don't have the time.

Larry

Re: Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Fri Sep 18, 2015 12:51 pm
by knight-of-ni
Your source path is incorrect. Notice that you have not told ZoneMinder the ip address nor the protocol to use in your screenshot. It has no way to connect to the camera in question.

Also note that the resolution you state in ZoneMinder has to match the resolution in the camera, exactly.
When I using SourceType=Ffmpeg/videostream.cgi?rate=11, I see alot of
If you use videostream.cgi, your source type should be remote according to the wiki. See the link referenced earlier:
http://www.zoneminder.com/wiki/index.php/Foscam_FI8918W

Re: Cannot create JPEGs with v1.28.1/Ubuntu 14.04/FI8918W

Posted: Wed Sep 23, 2015 8:48 pm
by bbunge
I also posted this in the 1.26.x area.

One more time!

I had my production server hard drive crash the other day. So, with a new WD drive I set about installing Ubuntu 14.04 with ZM 1.28.1 from the PPA. Everything went well until I got to the Foscam FI8910W.

I set it up as remote with Remote Host Path of: /videostream.cgi?user=visitor&pwd=visitor1

The camera has an "Operator" of visitor.

And ZM wold not connect to the camera and work!

What did work was to use the camera administrator user and password like: /videostream.cgi?user=admin&pwd=password1

Additionally I added &rate=11 to the end of the line to lower the camera frame rate to 5 FPS.

Since the FI8918W and FI8910W are reported to have the same settings it should now work for you.