Saturday, 18 January 2020

Convert cheap security camera into nature camera

Live-streaming commercial IP cameras can be expensive.  I don't like expensive.

...there are cheap ones, but they're often hard-wired into the 'cloud', and stop you viewing the camera without an internet connection, often requiring more ££/$$ out of you to actually use the camera's full potential.  I'm also not a fan of streaming content 24/7 to an online faceless cloud only to have to download it back again to view it...  </end of rant>

Ryan Fitton's blog describes how a cheap IP security camera, the 'Neos SmartCam' can be simply modified to enable access its local video stream (called an rtsp stream).  We can then do some cool stuff with it to replicate and extend the limited cloud motion detection functionality.  The camera is available from Amazon here.



The good bits
  • Its a £25 wide angle wifi IP camera.  
  • You can view the livestream locally and remotely (remote needs internet at both sites)
  • It has night and day modes - night mode uses IR leds which are ok over a short distance.  
  • It does motion capture in the cloud
  • There's a smartphone/tablet app that lets you manually record clips live of ?unlimited length.

This is an example of a motion-captured clip on an unmodified camera (note its not waterproof!).

The bad bits
  • Motion capture relies on an active internet connection.
  • Motion capture videos are poorer resolution than manually captured ones.
  • Constant use of your internet connection.
  • Without more ££/$$ you only get 10 second clips that are limited to 10 min triggering interval.
  • The number of clips it saves is limited to maybe the last ?10.   
  • Neos expect a lot of personal info on initial configuration - I don't like that at all.
  • The local video stream, is NOT available.  I tried really hard!
  • 'Full' functionality is only available at extra subscription cost
Neos SmartCam.  They know where you live if you let them.

No Thanks.
So lets's fix it!!

Ryan's blog describes a method to make the video stream accessible locally in the form of an RTSP video stream.  To do this, you replace the camera's on-board software (the 'firmware').  This also removes the the motion capture functionality as this is done on Neos' cloud servers.  The method involves modifying the 'bootloader' to accept alternative firmware when turned on. To do this you need a blank micro SD card and some means to transfer custom firmware called 'DaFang hacks' to the unit.
DaFang hacks is custom firmware which you can flash to the camera via a MicroSD card. This give you benefits such as; no relying on the manufacturer’s cloud services, SSH and FTP services on the camera itself, and the best: RTSP stream support – this will allow you to integrate the camera into any DVR recording software, such as Shinobi, ZoneMinder or Synology’s Surveillance Station
My experience of modifying my Neos SmartCam was pretty simple.  The one difference to Ryan's account is that the 'ready' LED flash pattern on mine was different, showing a solid yellow LED signal. I also used an 8Gb micro SD card instead of a 16Gb one.  I also noticed that every time I used it on the stock firmware, the app kept telling me that it needed a firmware update.  DON'T DO THAT... I suspect that if you do it will remove the possibility of modifying the bootloader so that you can load custom firmware.  I cant prove that as I didn't try it, but its not worth the risk!

So now I have access to a local rtsp video feed from a cheap camera with day & night modes  plus all the camera configuration options 😊.

I modified the settings in the configuration browser as follows to get an acceptable framerate:
Video size: 960x540
Bitrate: 500
Framerate: 25 fps

Some things that you can with do an rtsp video stream:

  1. Motion capture via open-source CCTV application MotionEye on a Raspberry Pi (I do this)
  2. Motion capture using commercial DVR recording stations (I don't do this)
  3. Motion capture using commercial CCTV applications on a PC e.g. iCatcher (I did this).
  4. Local viewing of your camera's video on a PC using VLC 

Local motion capture example using MotionEye
Motion capture done locally that does not rely on streaming to the cloud.  I currently use MotionEye launched from a Docker image on on a Raspberry Pi to motion capture video from this camera.  Its really simple to setup, I will likely do a future post more detail.


Review video stream in a web browser OR livestream to YouTube for free
I've previously done a post about an excellent application called Restreamer. This takes an rtsp stream and outputs it as something that can be easily incorporated into a web browser.  It also allows you to stream directly to YouTube and other streaming providers with minimal effort, see my previous post for more details on this specifically. 

At the moment I'm using Restreamer to generate a video stream from this modified neos camera that I can load it into into my 'Wildlife Camera dashboard', which is one way to get all my cameras onto one screen via a web browser.  This is also possible using MotionEye, however this app can handle either the rtsp feed or the 'web-friendly' one from Restreamer.

Have fun with timelapse 
Once you can access the local video stream this sort of thing becomes a possibility.. coming to a future blog post  😎



Conclusion
Without updating the firmware its pretty much useless for my needs.  The updated firmware opens up all sort of potential, I'm considering where to use it, in an inside situation, maybe a owl box?

No comments:

Post a Comment