Page 1 of 2
Can zonminder service "crash" from low power?
Posted: Wed Jun 03, 2020 1:29 pm
by david1234
Hello ,
I have some problem running zoneminder v1.30.0 on my pi3 (this is the only thing I'm running on the pi)
the zonmidner server have only 1 ip camera , and after 3-4 movment recording it get stuck (and even when It recoreding , the image get stuck a lot - I don't get smooth captured video )
when I see the image live from the pi - I don't have this problem - so it's not a wireless problem (at least I think).
when I entet zonminder logs I see:
Code: Select all
do service zoneminder status
● zoneminder.service - ZoneMinder CCTV recording and surveillance system
Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; vendor prese
Active: failed (Result: exit-code) since Wed 2020-05-27 18:50:08 IDT; 3 days
Process: 9047 ExecStop=/usr/bin/zmpkg.pl stop (code=exited, status=1/FAILURE)
Process: 7547 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=0/SUCCESS
Main PID: 7576 (code=exited, status=4)
May 27 18:50:07 raspberrypi sudo[9053]: root : TTY=unknown ; PWD=/usr/share/
May 27 18:50:07 raspberrypi sudo[9053]: pam_unix(sudo:session): session opened f
May 27 18:50:07 raspberrypi sudo[9053]: pam_unix(sudo:session): session closed f
May 27 18:50:07 raspberrypi sudo[9061]: root : TTY=unknown ; PWD=/usr/share/
May 27 18:50:07 raspberrypi sudo[9061]: pam_unix(sudo:session): session opened f
May 27 18:50:08 raspberrypi sudo[9061]: pam_unix(sudo:session): session closed f
May 27 18:50:08 raspberrypi systemd[1]: zoneminder.service: Control process exit
May 27 18:50:08 raspberrypi zmc_m2[8703]: INF [Got signal 15 (Terminated), exiti
May 27 18:50:08 raspberrypi systemd[1]: zoneminder.service: Unit entered failed
May 27 18:50:08 raspberrypi systemd[1]: zoneminder.service: Failed with result '
I looked at /var/log/messages to find out why it stop
and saw this (arround the time the service has stop)
Code: Select all
ay 27 18:50:01 raspberrypi zmc_m2[8703]: WAR [Last image read from shared memory 14 seconds ago, zma may ha$
May 27 18:50:02 raspberrypi zmdc[7576]: WAR ['zma -m 2' has not stopped at 20/05/27 18:50:02. Sending KILL t$
May 27 18:50:02 raspberrypi zmdc[7576]: INF ['zma -m 2' exited normally]
May 27 18:50:06 raspberrypi zmc_m2[8703]: INF [Door: 87000 - Capturing at 20.83 fps]
May 27 18:50:07 raspberrypi zmpkg[9047]: INF [Sanity checking States table...]
May 27 18:50:07 raspberrypi zmpkg[9047]: INF [Command: stop]
May 27 18:50:08 raspberrypi zmc_m2[8703]: INF [Got signal 15 (Terminated), exiting]
May 27 23:09:03 raspberrypi kernel: [513027.215560] rpi_firmware_get_throttled: 1 callbacks suppressed
May 27 23:09:07 raspberrypi kernel: [513031.376407] rpi_firmware_get_throttled: 1 callbacks suppressed
May 27 23:09:07 raspberrypi kernel: [513031.376415] Voltage normalised (0x00000000)
May 28 05:09:08 raspberrypi kernel: [534632.135576] Voltage normalised (0x00000000)
May 28 06:09:08 raspberrypi kernel: [538232.601304] Voltage normalised (0x00000000)
the same thing I see in the syslog from today
Code: Select all
May 31 12:09:02 raspberrypi kernel: [819025.923383] Under-voltage detected! (0x00050005)
May 31 12:09:08 raspberrypi kernel: [819032.163370] Voltage normalised (0x00000000)
wanted to know if there is connection between the things?
maybe something happand to my power suplly , and this is why I'm getting all this errors?
and this is the reason zonminder stop working ?
Thanks,
Re: Can zonminder service "crash" from low power?
Posted: Wed Jun 03, 2020 4:32 pm
by mikb
Definitely sort out your power supply -- if you are getting under-voltage reports, and the CPU is throttling, you have an overloaded, defective or poor quality power supply.
ZM crashing is a likely consequence, so is the whole system hanging, data corruption, and destruction of the contents of the micro SD card, leaving you with an unusable system.
What is the brand/spec of the power supply running this pi?
What else is connected to the PI (USB devices, not networked) and are they being powered from the USB ports, or their own power supplies?
Did you plug in extra items while it was running to cause a sudden voltage sag?
Have you accurately measured the voltage AS SEEN AT THE PI?
A lot of the "better" power supplies don't deliver 5V, they already start at 5.2/5.3V to try and make sure the PI is seeing a good power source. Some the cheap ones may well deliver 4.8-4.9v, and possibly lower due to thin wires, poor connectors etc.
Re: Can zonminder service "crash" from low power?
Posted: Thu Jun 04, 2020 6:22 am
by david1234
it's some china power suplly
it work good for a year for otehr 5V device (but now wehn I look at the device he need up to 1.5A max)
up until next week I didn't even think about this
after I read your answer I ordered this
https://www.raspberrypi.org/products/ra ... er-supply/
nothing is connected to the pi (no mouse\keyboard\hdmi) - only netwrok cable
and all my work I do over vlc\ssh
when I get the power supply (next week hopfully) I will check and let you know
Thanks!
Re: Can zonminder service "crash" from low power?
Posted: Thu Jun 04, 2020 4:02 pm
by mikb
Although the USB spec does allow a tolerance under/over 5v, and other devices may well work with that PSU, a lot of the "Raspberry Pi approved" power supplies are set for the upper end of the voltage range to help with this.
Re: Can zonminder service "crash" from low power?
Posted: Sun Jun 07, 2020 10:35 am
by david1234
After replacing the power supply yesterdey ,it's been 24 hours
I don't see the "voltage error" in the syslog
so great! and thank for tell me what to do .
but now it's seem I have another problem
when I try to play the saved video -
I can see the vodeo is 20 seconds , but the image is stuck \ playing very slow \ jump +5 seconds
what could be the reason for it?
when I open the "live" video - the image seem to be OK , no stuck
the video is 640X480 32 bit colour http simple
the video was taken after I replace the power suplly to avoid other power issue
also when I try to do export , in the zip file I only have capture imgaes (I remember there was an option for avi\mpeg once)
I'm using
Code: Select all
Version
You are running the most recent version of ZoneMinder, v1.30.0.
No update is necessary.
Re: Can zonminder service "crash" from low power?
Posted: Sun Jun 07, 2020 7:08 pm
by burger
david1234 wrote: ↑Sun Jun 07, 2020 10:35 am
also when I try to do export , in the zip file I only have capture imgaes (I remember there was an option for avi\mpeg once)
I'm using
Code: Select all
Version
You are running the most recent version of ZoneMinder, v1.30.0.
No update is necessary.
In 1.30, to export a video you must include the ffmpeg binary in the system, and specify its path in the options - images tab. Next, view an event, and click the 'video' tab to create / download a video for the event.
Re: Can zonminder service "crash" from low power?
Posted: Mon Jun 08, 2020 11:08 am
by david1234
you mean this ?
Code: Select all
OPT_FFMPEG Is the ffmpeg video encoder/decoder installed *mark as V"(?)
PATH_FFMPEG Path to (optional) ffmpeg mpeg encoder (?) /usr/bin/ffmpeg
ffmpeg is installed in the pi
in the same location as mention up
Code: Select all
pi@raspberrypi:~ $ /usr/bin/ffmpeg
ffmpeg version 3.2.14-1~deb9u1+rpt1
maybe another setting is is missing ?
please look at the atach picture

- Capture.PNG (37 KiB) Viewed 9738 times
also - maybe because it doesn't work it also explain why when I watch a saved video - it get stuck all the time ?
Thanks,
Re: Can zonminder service "crash" from low power?
Posted: Thu Jun 11, 2020 1:48 am
by burger
First, remove the output options from ffmpeg (for now).
Second, confirm that ffmpeg works from the command line. See wiki.zoneminder.com/Ffmpeg for basic usage. Try the example, in a folder of jpegs, and confirm the output file is a valid video.
Third, Honestly, may just be a good idea to update. 1.29 or 1.30 is 4+ year old software at this point. Ffmpeg encode works on x86, but I haven't tested it out on ARM / RPI. Or you can live with the broken ffmpeg encoding. Are you sure it's not an issue of permissions on the ffmpeg binary or similar? I'm unsure if it runs as root or www-data, but you can just chmod 777 it to test.
If you choose to update: 1.32.3 is in the rpi repos for Raspbian 10, and you can get 1.34 using the install guides at
https://wiki.zoneminder.com/Debian
Even numbers (32, 34) are stable. Odd numbers are dev. Stick with even numbers.
Re: Can zonminder service "crash" from low power?
Posted: Thu Jun 11, 2020 7:11 am
by david1234
thank you for the reaply
I just want to make sure I do what you said correct:
1. In the ffmpeg_output_options I remove the "-r 25"
2.I looked at the wiki , but my camera doesn't support rtsp
only http
so from the example
Code: Select all
ffmpeg -i rtsp://admin:password@192.168.1.64:554/video/1 output.mp4
I change to this:
Code: Select all
ffmpeg -i http://admin:password@10.0.0.9:99/videostream.cgi output.mp4
I let it run for ~10 seconds , it create a output.mp4 size 1.2M~
when I try to play it in windows , I get first 5 seconds black , 5 more seconds pixels movie not so clear image.
I have try this sevral times , and it's seems that i have 5 seconds dealy in the record
because I see that when I stop the recording using 'q' , the output clips stop ~ 5-7 seconds before I press 'q'.
maynr this also connected?
when I see live video - I have no problems (it run almost clear )
3. if it create a file meaning the permission is Ok , no ?
but this is the permission
Code: Select all
ls -l /usr/bin/ffmpeg
-rwxr-xr-x 1 root root 243384 May 25 2019 /usr/bin/ffmpeg
I try to run the command using sudo - same resualt
4. in the link you sent , there is only fresh installation - is there a way just to run just update\upgrage?
I don't want to start over (It will requir me to install the pi from start ,to be sure I remove old files\setting)
just to be sure , I have connected a usb camera (to avoid netwrok problems ) - I get the same resulat while capture and recording video
thank you for your help!
Re: Can zonminder service "crash" from low power?
Posted: Sat Jun 13, 2020 7:11 pm
by burger
Some quick tips that aren't worth much,
RPI may be running out of CPU / memory with ffmpeg. Stop ZM before testing ffmpeg on cmd line. Don't run X server.
With ZM, you might want Raspberry Pi 4 (with 2+GB RAM), and adjust gpu_mem. See
https://wiki.zoneminder.com/Single_Board_Computers
If you have older RPI, you still can adjust gpu_mem, I think. But be aware that what you use for gpu_mem will be taken from base RAM.
Lower resolution on camera, and also FPS. Get it working at low res first.
Reinstalling from scratch w/RPI should be easy. Grab raspbian 10 image, run through ZM install steps. Won't take more than an hour. However, there is a ready to go image for rpi (rpi3 was tested) on
https://zmrepo.zoneminder.com scroll to the bottom
Re: Can zonminder service "crash" from low power?
Posted: Sun Jun 14, 2020 6:34 am
by david1234
I looked at the cpu while it recording and the ZM was off , it doesn't go more then 55%.
run this command
Code: Select all
ffmpeg -i /dev/video0 output.mp4 -r 25 -vcodec libx264
the record video was much better and running almost without any problems \jumps
so maybe to try to use this commands in the image setting?
also -if I reduce the FPS in the usb camera?
I will put 25 in the image-setting , it will help?
I see it's 30 FPS while running live and the resulotion is 352X288 only
and last question:
I will but a new SD card and will try to install the image you suggested
we are talking about this one, right?
2020-02-13-raspbian-buster-zoneminder-1.34-0.1.img.bz2
it just plug&play , right?
no need to run\install anything else on it?
again ,
Thank you so much for your time and help!
Re: Can zonminder service "crash" from low power?
Posted: Tue Jun 16, 2020 9:55 am
by david1234
I have try to run the image you told me .
new SD card , only 1 usb camera
didn't change\download anything on the pi
connected only 1 usb camera
when watching live video - everything is OK run almost smooth
but when I try to watch the saved video it get stuck\play slow\ jump to end
the only thing i have done when adding the usb camera is
analysis fps =10
how could it be ?
how could that "Zonminder" can't run and save 1 video from a usb camera?
in the logs I don;t see any prboems nothin that say ther is a problem in the capture
can you guide \ help ?
Thanks ,
Re: Can zonminder service "crash" from low power?
Posted: Wed Jun 17, 2020 8:05 am
by david1234
another thing that maybe help you help me
I have connected Ip camera and monitor it
I have run the ffmpeg function while the server is up and running
using this command :
Code: Select all
ffmpeg -i http://admin:password@10.0.0.5:5555/videostream.cgi Test1.avi -r 20 -vcodec libx264
the video that was created was 100% good ,
didn't stuck , the video was great !
so there is no CPU issue
the codec is OK
have also try this command
Code: Select all
ffmpeg -i http://admin:password@10.0.0.5:5555/videostream.cgi Test.mpeg
also the video was 100% good
and all this while the usb camera is working and the server is up
so it must be something in the setting on the zonminder recording no ?
when I export the video -
5 images with the same timestemp 17:00:00
then it jump to 5 images with 17:00:15
them 7 images with timestemp 17:00:25
so what could it be ????
please take a look and tell me what is wrong
Thanks ,
Re: Can zonminder service "crash" from low power?
Posted: Thu Jun 18, 2020 12:11 am
by burger
Some cameras are better supported than others. It may be that the webcam doesn't work well.
See camera recommendations in
https://wiki.zoneminder.com/Hardware_Compatibility_List
and
https://wiki.zoneminder.com/Beginner_hardware
Re: Can zonminder service "crash" from low power?
Posted: Thu Jun 18, 2020 6:12 am
by david1234
OK /
I looked at the this part;
https://wiki.zoneminder.com/Hardware_Compatibility_List
in USB Cameras
and it said:
Most UVCvideo cameras
note that most USB cameras that can use Video4Linux/V4L2,
how can I tell if my camara is like this?
I'm using 4atech usb camera
I get the same resault using wanscam ip camaera which is on the list
another thing
when I run the ffmpeg command - the video was created perfect (both on USB and IP camera - even at the same time)
so maybe zonminder is not the software I need ?
and will not work with my hardware ? very stange it's not good just for me
can you think about other options so I can change them and try?
Thank you