Skip to content
Motion detection, MP4 output, MJPEG streaming, 720p@20fps. From a single RasPi
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
etc/systemd
videos
main.py
readme.md

readme.md

Installation

It's been a while since I installed from scratch. Need to try these steps again:

apt-get install python3-pip python3-picamera
pip3 install opencv-python
# numpy imutils?

modprobe bcm2835-v4l2
# add that module to /etc/modules-load.d/modules.conf

Then run: python3 main.py

Usage

It's not very user-friendly yet.

Ctrl-C will make it shutdown gracefully.

Look for width, height and fps variables in main.py. Line 377. Edit to your liking.

Miscellaneous Notes

check ffmpeg codecs for h264 and omx for hardware accelerated encoding on the raspi:

ffmpeg -codecs | grep h264

See options for the hardware encoder, there aren't many!

ffmpeg -h encoder=h264_omx

Future Thoughts

I'm curious whether we can use h264 instead of jpeg. Perhaps we can then simply ask ffmpeg to add an mp4 container. https://support.mozilla.org/en-US/kb/html5-audio-and-video-firefox#w_supported-formats

You can’t perform that action at this time.