| | 1 | I have 2 FOSCAM HD IP camera and 1 UBNT airVision (old model) IP camera which are used for surveillance monitoring. Storage of images is done on the camera's itself, so I only needed something to view the live feeds of the camera's combined an a single screen. I had an old HDMI screen laying around and the Raspberry Pi 3 is yet the perfect (inexpesive fit) for this purpose. |
| | 2 | |
| | 3 | |
| | 4 | = Getting started = |
| | 5 | * Install the standard debian Raspberry Pi and make sure to select console mode. We do need any GUI, since we will be using omxplayer to |
| | 6 | |
| | 7 | |
| | 8 | = Monitoring of camera feeds = |
| | 9 | |
| | 10 | /root/kill_stuck_omxplayer.sh: |
| | 11 | {{{ |
| | 12 | #!/bin/sh |
| | 13 | # |
| | 14 | # Quick to deal with omxplayers which are in deadloop, |
| | 15 | # detection based on low-CPU usage |
| | 16 | # |
| | 17 | for PID in `pgrep omxplayer.bin`; do |
| | 18 | PCPU=`ps -p $PID -o pcpu=` |
| | 19 | if echo $PCPU 2.0 | awk '{exit $1<$2?0:1}'; then |
| | 20 | echo "Lets kill pid $PID" |
| | 21 | kill -KILL $PID |
| | 22 | fi |
| | 23 | done |
| | 24 | }}} |
| | 25 | |
| | 26 | /etc/crontab: |
| | 27 | {{{ |
| | 28 | * * * * * root /root/kill_stuck_omxplayer.sh | logger |
| | 29 | }}} |