Notes on getting Motion + MotionEye working with the Aprica CCTV DVR

The web interface on the Aprica CCTV DVR is terrible, it requires a proprietary plugin to view video and doesn’t have many of the features I would like.

In the past I’ve played with MotionEye for recording and managing IP network cameras, MotionEye uses motion in the background to get the video streams from the cameras. Unfortunately motion does not support the RTSP protocol or H264 codec used by the CCTV DVR’s web interface.

There is however a fork of the motion project on github that has got RSTP + H264 available at https://github.com/Mr-Dave/motion I removed the version of motion from the Ubuntu repositories and followed the instructions in the INSTALL file and built the new version of motion.

After replacing motion with the new one I was able to add the RTSP streams from the DVR to MotionEye. (Setting the URL as rtsp://192.168.1.35:554/user=admin&password=&channel=6&stream=0.sdp )motionEye

Unfortunately this solution isn’t perfect, occasionally the streams appear to ‘glitch’ and you end up with some garbage until the next key frame (I assume) comes by and the video is reset.

The bigger problem is that the video feed is not the clearest and there is lots of static like interference, this is most visible at night when the cameras switch to IR mode. This interference means that the standard motion detection algorithm used by the motion application is constantly detecting motion false positives which makes any motion detection useless.

I plan to experiment with various settings within the motion application to see if its possible to strike a balance so that it is able to detect people reliably. Ultimately though I’ll be using one of the ‘computer vision’ libraries like OpenCV to detect objects / movement in each of the cameras views and then alert someone.