Giter Club home page Giter Club logo

sentry-picam's Introduction

Sentry-Picam

Mosaic of a 3d printed sentry turret, bird, and screenshot of a bar graph

Sentry-Picam is a simple wildlife / security camera solution for the Raspberry Pi Zero W, providing 1080p/30fps motion activated H.264 video capture. The built in web interface makes it easy to review video clips and identify the busiest times of day.

Recordings will be kept as long as there's enough available space. 1 GiB of free space will be maintained by default.

Motion detection in Sentry-Picam uses vectors provided by RaspiVid's video pipeline, enabling performant and effective supression of video noise.

Thanks to Broadway and RaspiVid, the Pi Zero W hardware can also stream live video to multiple devices with a ~300ms delay over Wifi.

Minimum Hardware Requirements

  • Raspberry Pi Zero
  • Raspberry Pi Camera Module v2

Prerequisite Software

  • raspivid - Required for motion vector data. Available in Raspberry Pi OS Debian version: 10 (buster).
  • ffmpeg - Used for custom triggers and video conversion/thumbnails

Quick Setup

  • Ensure camera is enabled in raspi-config
wget https://github.com/TinkerTurtle/Sentry-Picam/releases/latest/download/sentry-picam
./sentry-picam

Navigate to http://IP_address_of_your_RPi:8080

Tips

  1. The default video settings strike a good balance between video quality and resource usage. To View options:

    ./sentry-picam -help
    
  2. For higher quality on Camera Module v2:

    ./sentry-picam -height 1088 -width 1920 -fps 30 -bitrate 4000000
    
  3. Use "Edit Detection Sectors" in the web UI to specify areas where motion detection should be triggered.

  4. Set up auto start:

    Download and edit the sentry-picam.service file.

    sudo cp sentry-picam.service /etc/systemd/system/
    sudo systemctl enable sentry-picam
    sudo systemctl start sentry-picam
    
  5. Custom programs can be set up to trigger other functionality, like notifications or image classification. Ffmpeg is a prerequisite.

    Sentry-picam runs your program after generating a thumbnail, and passes in the video/thumbnail name as an argument to your program. Your program will need to append the .mp4 file extension to access the video, or .jpg to access the thumbnail. Recordings are stored in ./www/recordings/

    ./sentry-picam -run example_script.sh
    
  6. Files discarded from the web interface may be recovered from the folder ./www/recordings/deleteme/. The web interface will occasionally empty this folder, starting with recordings over 7 days old.

Compiling from Windows for a Raspberry Pi Zero

git clone https://github.com/TinkerTurtle/sentry-picam
cd sentry-picam

# Set environment variables for the Go compiler
SET GOOS=linux
SET GOARCH=arm
SET GOARM=6

go build

STLs for the Portal Turret

https://www.thingiverse.com/thing:8277

https://www.prusaprinters.org/prints/76478-supplemental-portal-turret-components

Enjoy!

Cardinal swinging on a birdfeeder while eating birdfeed

sentry-picam's People

Contributors

photon-schiesser avatar tinkerturtle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sentry-picam's Issues

Spelling error in Web Interface

Hi,

sorry, I don't have the means to produce a pull request right now, but I just spotted this little typo in the /www/index.html file on line 60:

<button type="button" id="btn_modeNight" onclick="cam.set({mode: 'NIGHT'}; modal.close();)">๐ŸŒ™ Night mode</button>
should be
<button type="button" id="btn_modeNight" onclick="cam.set({mode: 'NIGHT'}); modal.close();">๐ŸŒ™ Night mode</button>

The same way as it is in the line above (day mode).

'invalid argument' after cam.startrecord()

after typing

cam.startrecord()

in the javascript console,

I get no video record ; instead a lot of lines like
2020/08/22 14:46:58 Message Received: startrecord
2020/08/22 14:47:11 invalid argument
2020/08/22 14:47:11 invalid argument
...
2020/08/22 14:47:19 invalid argument
2020/08/22 14:47:20 invalid argument
2020/08/22 14:47:20 invalid argument
2020/08/22 14:47:20 invalid argument
2020/08/22 14:47:20 invalid argument
2020/08/22 14:47:20 Message Received: stoprecord

in the bash console of simple-webcam. the messages are triggered at the first motion detected after startrecord until a stoprecord is received.

as as side note, I have a few more errors and warnings on Brave as well as no video display (only the motion detection squares), not sure if this is related. Attaching a screenshot for reference: https://www.imgpaste.net/image/9SGNa

USB Cam

Hello

Thank's for this project, much better for me than MotioneyeOS.

My camera work perfecly with a rasp cam inside a 3d print Portal 2 camera.

I would like to use a usb camera (better quality) , but when i plug it, it doesn't work.

Sentry picam work with usb cam ?

Thx

FLUX MOTIONEYES

Good morning

Thanks for your project.
I am currently trying to recover the video stream in motionEyes but it does not work, are there any particular things to do or modify?
Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.