Escam QD300 H.264 Camera 720p losing connection every 15 sec

Forum for questions and support relating to the 1.28.x releases only.
Locked
baekmark
Posts: 30
Joined: Wed Mar 21, 2007 8:31 pm
Location: Denmark

Escam QD300 H.264 Camera 720p losing connection every 15 sec

Post by baekmark »

Hi all

I have just made a free install of Zoneminde on my Ubuntu 14.10 the easy way. The hardware is a Pentium 4 with 4 GB of memory.
uname -a Linux Zoneminder 3.16.0-28-generic #38-Ubuntu SMP Fri Dec 12 17:37:40 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

My camera that I'm using right now is "Foscam"ish like FI8916, FI8904 and FI8905 and some IP cam that looks like Foscam. It's very stable and is running without any problem what so ever.

But yesterday I got a new Escam QD300 "Brick" camera, and according to various sources on the internet, this camera will work with Zoneminder 1.28.
1) http://www.amazon.com/Escam-Peashooter- ... Descending
2) http://digdilem.org/cameras/?action=view&id=158

My setup is this:
Source type: Ffmpeg
Source Path: rtsp://172.31.3.7:554//user=visitor&password=&channel=1&stream=0.sdp?
Remote Method: RTP/Unicast
Colorspace: 24 Bit
1024/720

The QD300 camera has been setup from a Windows 7 and IE. And It's running perfectly within an IE browser. Most of the setting is default, just some DHCP stuff, and text removed from the GUI

Well I'm able to get a picture from the camera, but it's static. Like it's only updating each 30 sec. (not very live)

My log is showing this: (look for NewDriveway and 172.31.3.7)
2015-01-20 09:48:56.051620 zmwatch[20774].INF-zmwatch.pl [Restarting capture daemon for NewDriveway, time since last capture 14 seconds (1421743736-1421743722)]
2015-01-20 09:48:59.351440 zmdc[20596].INF-zmdc.pl ['zmc -m 7' starting at 15/01/20 09:48:59, pid = 21363]
2015-01-20 09:48:59.357460 zmdc[21363].INF-zmdc.pl ['zmc -m 7' started at 15/01/20 09:48:59]
2015-01-20 09:48:59.822469 zmc_m7[21363].INF-zmc.cpp/195 [Starting Capture]
2015-01-20 09:48:59.881246 zmc_m7[21363].INF-zm_ffmpeg_camera.cpp/114 [Priming capture from rtsp://172.31.3.7:554//user=visitor&password=&channel=1&stream=0.sdp?]
2015-01-20 09:49:04.296370 zma_m7[20747].INF-zm_monitor.cpp/1492 [NewDriveway: 2046 - Gone into alert state]
2015-01-20 09:49:04.972628 zmc_m7[21363].FAT-zm_ffmpeg_camera.cpp/262 [Unable to decode frame at frame 33]
2015-01-20 09:49:05.021290 zmdc[20596].ERR-zmdc.pl ['zmc -m 7' exited abnormally, exit status 255]
2015-01-20 09:49:08.773418 web_php[20526].ERR-/usr/share/zoneminder/includes/functions.php/2330 [socket_sendto( /var/run/zm/zms-843696s.sock ) failed: No such file or directory]
2015-01-20 09:49:10.411678 zma_m5[20695].INF-zm_monitor.cpp/1150 [LivingRoom: 10000 - Processing at 7.41 fps]
2015-01-20 09:49:14.573854 web_js[20526].ERR-?view=watch [getStreamCmdResponse stream error: socket_sendto( /var/run/zm/zms-843696s.sock ) failed: No such file or directory - checkStreamForErrors()]
2015-01-20 09:49:19.499560 zmwatch[20774].INF-zmwatch.pl [Restarting capture daemon for NewDriveway, time since last capture 15 seconds (1421743759-1421743744)]
2015-01-20 09:49:22.713410 zmdc[20596].INF-zmdc.pl ['zmc -m 7' starting at 15/01/20 09:49:22, pid = 21369]
2015-01-20 09:49:22.717080 zmdc[21369].INF-zmdc.pl ['zmc -m 7' started at 15/01/20 09:49:22]
2015-01-20 09:49:23.178977 zmc_m7[21369].INF-zmc.cpp/195 [Starting Capture]
2015-01-20 09:49:23.208996 zmc_m7[21369].INF-zm_ffmpeg_camera.cpp/114 [Priming capture from rtsp://172.31.3.7:554//user=visitor&password=&channel=1&stream=0.sdp?]
2015-01-20 09:49:26.404909 zma_m7[20747].INF-zm_monitor.cpp/1499 [NewDriveway: 2071 - Left alarm state (21680) - 63(13) images]
2015-01-20 09:49:26.442263 zma_m7[20747].INF-zm_monitor.cpp/1504 [NewDriveway: 2071 - Closing event 21680, alarm end]
2015-01-20 09:49:27.473181 zmc_m7[21369].FAT-zm_ffmpeg_camera.cpp/262 [Unable to decode frame at frame 27]
2015-01-20 09:49:27.542590 zmdc[20596].ERR-zmdc.pl ['zmc -m 7' exited abnormally, exit status 255]
2015-01-20 09:49:32.123063 web_php[20526].ERR-/usr/share/zoneminder/includes/functions.php/2330 [socket_sendto( /var/run/zm/zms-843696s.sock ) failed: No such file or directory]
2015-01-20 09:49:42.866230 zmwatch[20774].INF-zmwatch.pl [Restarting capture daemon for NewDriveway, time since last capture 15 seconds (1421743782-1421743767)]
2015-01-20 09:49:43.104829 zmc_m2[20636].INF-zm_monitor.cpp/2899 [Driveway: 11000 - Capturing at 7.94 fps]
2015-01-20 09:49:43.475370 zmdc[20596].INF-zmdc.pl ['zmc -m 7' starting at 15/01/20 09:49:43, pid = 21374]
2015-01-20 09:49:43.496670 zmdc[21374].INF-zmdc.pl ['zmc -m 7' started at 15/01/20 09:49:43]
2015-01-20 09:49:43.929704 zmc_m7[21374].INF-zmc.cpp/195 [Starting Capture]
2015-01-20 09:49:43.969729 zmc_m7[21374].INF-zm_ffmpeg_camera.cpp/114 [Priming capture from rtsp://172.31.3.7:554//user=visitor&password=&channel=1&stream=0.sdp?]
2015-01-20 09:49:44.206733 zmc_m3[20651].INF-zm_monitor.cpp/2899 [MainEntrance: 11000 - Capturing at 8.00 fps]
2015-01-20 09:49:44.493164 zma_m3[20654].INF-zm_monitor.cpp/1150 [MainEntrance: 11000 - Processing at 8.06 fps]
2015-01-20 09:49:47.869295 zmc_m7[21374].FAT-zm_ffmpeg_camera.cpp/262 [Unable to decode frame at frame 26]
2015-01-20 09:49:47.926510 zmdc[20596].ERR-zmdc.pl ['zmc -m 7' exited abnormally, exit status 255]
2015-01-20 09:49:47.963724 web_php[20842].ERR-/usr/share/zoneminder/includes/functions.php/2330 [socket_sendto( /var/run/zm/zms-843696s.sock ) failed: No such file or directory]
2015-01-20 09:49:53.596930 zmwatch[20774].INF-zmwatch.pl [Restarting capture daemon for NewDriveway, time since last capture 6 seconds (1421743793-1421743787)]
2015-01-20 09:49:53.909198 web_js[20842].ERR-?view=watch [getStreamCmdResponse stream error: socket_sendto( /var/run/zm/zms-843696s.sock ) failed: No such file or directory - checkStreamForErrors()]
2015-01-20 09:49:54.531760 zmdc[20596].INF-zmdc.pl ['zmc -m 7' starting at 15/01/20 09:49:54, pid = 21379]
2015-01-20 09:49:54.535340 zmdc[21379].INF-zmdc.pl ['zmc -m 7' started at 15/01/20 09:49:54]
2015-01-20 09:49:55.021777 zmc_m7[21379].INF-zmc.cpp/195 [Starting Capture]
2015-01-20 09:49:55.068603 zmc_m7[21379].INF-zm_ffmpeg_camera.cpp/114 [Priming capture from rtsp://172.31.3.7:554//user=visitor&password=&channel=1&stream=0.sdp?]
2015-01-20 09:50:08.952412 zma_m7[20747].INF-zm_monitor.cpp/1436 [NewDriveway: 2174 - Gone into alarm state]
2015-01-20 09:50:09.038818 zma_m7[20747].INF-zm_monitor.cpp/1456 [NewDriveway: 2174 - Opening new event 21681, alarm start]
2015-01-20 09:50:11.632887 web_php[20842].ERR-/usr/share/zoneminder/includes/functions.php/2330 [socket_sendto( /var/run/zm/zms-843696s.sock ) failed: No such file or directory]
2015-01-20 09:50:11.686572 zmc_m7[21379].FAT-zm_ffmpeg_camera.cpp/262 [Unable to decode frame at frame 91]
2015-01-20 09:50:11.797770 zmdc[20596].ERR-zmdc.pl ['zmc -m 7' exited abnormally, exit status 255]


ipcs -l

------ Messages Limits --------
max queues system wide = 7003
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384

------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 524288
max total shared memory (kbytes) = 18014398442373116
min seg size (bytes) = 1

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767

I appreciate any help/hints etc...

Thanks

Lars
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Escam QD300 H.264 Camera 720p losing connection every 15

Post by bbunge »

Things to try:

End your Source Path with ?tcp to force the use of TCP

Turn down the frame rate (try 5 or less) and image quality on the camera. If you get "smearing" adjust the key frame rate to send a full image more often.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Escam QD300 H.264 Camera 720p losing connection every 15

Post by knight-of-ni »

It is stopping because it is unable to decode the frame. Of course, the million dollar question is why.

Your cpu looks a little weak for seven cameras, especially if you are using a source type of ffmpeg or libvlc to decode each stream.
To verify this is not a resource issue, disable all cameras (make sure and set the function to "none") except for the one in question.
Verify the camera is set to a reasonable frame rate like your other cameras (~8 is perfect).

Does the camera work now or do you get the same error?
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/
baekmark
Posts: 30
Joined: Wed Mar 21, 2007 8:31 pm
Location: Denmark

Re: Escam QD300 H.264 Camera 720p losing connection every 15

Post by baekmark »

Hi all

@bbunge
that didn't change anything

@knnniggett
All cameras has been set to "None" but the result is still the same. Same entry in the log file
Some years ago I did try with a total of 11 cameras, all MJPEG, without any problem.


BR
Lars
baekmark
Posts: 30
Joined: Wed Mar 21, 2007 8:31 pm
Location: Denmark

Re: Escam QD300 H.264 Camera 720p losing connection every 15

Post by baekmark »

Hi all

I have been down the performance route, and it didn't help.
An Sun X4150 with dual Quad Core Intel CPU and 32 GB of memory, and a fast SAS drive did not make the camera more useable.

Fresh installed with Ubuntu 14.10 64 bit, and no other camera that the Escam produce the same error log.
Damn it would be nice if anyone out there did use the same camera and was able to share some info on how to set up the camera side, as well as the ZM side.

Appreciate any help!
baekmark
Posts: 30
Joined: Wed Mar 21, 2007 8:31 pm
Location: Denmark

Re: Escam QD300 H.264 Camera 720p losing connection every 15

Post by baekmark »

Hi all
just want to update you with my latest finding.

I made an experiment, I got hold of my Sun X4150 server once again, and made a new installation of CentOS 6 by following this guide: http://www.if-not-true-then-false.com/2 ... tallation/

I'm 100% sure that any guide would have done the trick.
After making sure that the sever was updated, I made the Zoneminder install by following this guide: https://blog.yibi.org/tag/zoneminder-centos

Now my camera is working with Ffmpeg! No losing connection or other errors in the log file. I had it running for more than four hours without any glitch
The difference between the installation is Ubuntu/CentOS. Zoneminder is 1.28.1 on both servers
Just to make sure that running on CentOS made the difference, I tested with my normal Zoneminder server running Ubuntu and ZM 1.28.1. And very reliable it did produce the error: zmc_m7[21369].FAT-zm_ffmpeg_camera.cpp/262 [Unable to decode frame at frame 27]

By luck I found this page: https://www.devin.cl/blog/escam-ip-camera/
Same camera as mine, and running with Ubuntu. But he is using Libvlc, so that made my try the same thing, and what do you know! It's kind of working, but the frame rate is under the floor rendering that solution not useable!

Any one having an idea on why that is?

I appreciate any help/hints etc...

Lars
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Escam QD300 H.264 Camera 720p losing connection every 15

Post by knight-of-ni »

Nice work.

My guess as to the root cause of the problem was Ubuntu's choice of ffmpeg library. Ubuntu has chosen to ship with a library called libav. It claims to be compatible with ffmpeg, but it is not 100% compatible. This makes developing zoneminder difficult since we try to support both as best as we can. While zoneminder will technically work with libav, ffmpeg contains a few newer/different function calls that zoneminder makes use of. The issue with your camera has probably got something to do with that.

I'm not sure I understand what you mean by "the frame rate is under the floor rendering that solution not useable".
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/
baekmark
Posts: 30
Joined: Wed Mar 21, 2007 8:31 pm
Location: Denmark

Re: Escam QD300 H.264 Camera 720p losing connection every 15

Post by baekmark »

Hi Knnniggett

what I meant was that the frame rate was very low, and I somehow can't use the solution if the frame rate is under 1 per sec.

Right now I can see that the load on the server is very high 6.00

From top:
%Cpu(s): 94.0 us, 2.3 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 3.6 si, 0.0 st
KiB Mem: 3587832 total, 3321548 used, 266284 free, 674380 buffers
KiB Swap: 3657724 total, 89516 used, 3568208 free. 1712128 cached Mem

So the solution with Libvlc is not the best!

Lars
yibi
Posts: 2
Joined: Thu Apr 24, 2014 5:59 am

Re: Escam QD300 H.264 Camera 720p losing connection every 15

Post by yibi »

There's a still a gap with libvlc. I got it working at one point but subsequent upgrading broke it. I suggest sticking with ffmpeg for now.
Locked