Go to advanced search

by killagreg
Tue Mar 28, 2017 11:00 pm
Forum: Python
Topic: picamera overlay problem
Replies: 3
Views: 1948

Re: picamera overlay problem

I have exactly the same problem. Code is working well but on console error output python echos Traceback (most recent call last): File "_ctypes/callbacks.c", line 314, in 'calling callback function' File "/usr/lib/python2.7/dist-packages/picamera/mmalobj.py", line 1227, in wrapper self._pool.send_bu...
by killagreg
Thu Jan 01, 2015 7:11 pm
Forum: Camera board
Topic: Lightweight python motion detection
Replies: 259
Views: 281186

Re: Lightweight python motion detection

Now I have a moderator in the motion detection that fires an event only if in 2 consecutive frames a motion above the threshold has been detected. This improves the algo in terms of real motion when the treshold is set very low (maybe around 4) In addition an external programm can be called at motio...
by killagreg
Wed Dec 31, 2014 2:18 pm
Forum: Camera board
Topic: Lightweight python motion detection
Replies: 259
Views: 281186

Re: Lightweight python motion detection

There's a few obscure (to me) bugs; 1. with timestamps on the video captures, the displayed timestamp says "frozen" as the time of last capture on the "before detection" footage and then it proceeds normally during "after detection" until end of capture. I suspect moving some "if then" time-stampin...
by killagreg
Tue Dec 30, 2014 10:23 pm
Forum: Camera board
Topic: Lightweight python motion detection
Replies: 259
Views: 281186

Re: Lightweight python motion detection

I am using this shell script named picam.sh to start my pythom motion application named picam.py located under /home/pi #!/bin/sh # Change the next 3 lines to suit where you install your script and what you want to call it DIR=/home/pi/ DAEMON=$DIR/picam.py DAEMON_NAME=picam DAEMON_USER=root PIDFILE...
by killagreg
Mon Dec 29, 2014 10:31 pm
Forum: Camera board
Topic: Lightweight python motion detection
Replies: 259
Views: 281186

Re: Lightweight python motion detection

First install vlc on Pi. sudo apt-get install vlc Then modify the python script by adding the line import sys at the start of the script and insert camera.start_recording(sys.stdout, splitter_port=3, format='h264', resize=(640, 480) ) to output the h264 data stream to standard out. Run the python sc...
by killagreg
Mon Dec 29, 2014 6:07 pm
Forum: Camera board
Topic: Lightweight python motion detection
Replies: 259
Views: 281186

Re: Lightweight python motion detection

What Kind oft streaming do you want? A mjpg stream embedded in a HTML page vor a pure h264 stream?
by killagreg
Sun Dec 28, 2014 4:57 pm
Forum: Camera board
Topic: Lightweight python motion detection
Replies: 259
Views: 281186

Re: Lightweight python motion detection

I'd like the possibility to play around with the motion vector data (x,y, sad) of the macro blocks of the h264 encoder of the graphics chip. This is a real powerfull tool for further improvements. At the moment we are playing only with the motion vector lenght thesholding for motion detection by cal...
by killagreg
Sun Dec 28, 2014 12:59 pm
Forum: Camera board
Topic: Lightweight python motion detection
Replies: 259
Views: 281186

Re: Lightweight python motion detection

I have invoked the thread seperation now for mp4 transcoding after motion recording. #!/usr/bin/python # This script implements a motion capture surveillace cam for raspery pi using picam. # It uses the motion vecors magnitude of the h264 hw-encoder to detect motion activity. # At the time of motion...
by killagreg
Sun Dec 28, 2014 11:16 am
Forum: Camera board
Topic: Lightweight python motion detection
Replies: 259
Views: 281186

Re: Lightweight python motion detection

As for speed, logging suggests there's at least one potential choke point (pending checking for a bug) where we lose around 10 seconds of motions detection and recording - around the time of splitting from the circular IO memory buffer into an "after" h264 file. We do not loss video there, because ...
by killagreg
Sat Dec 27, 2014 9:55 pm
Forum: Camera board
Topic: Lightweight python motion detection
Replies: 259
Views: 281186

Re: Lightweight python motion detection

Hi together, i've used some hours during the xmas holidays to improve the code a bit. I have now the h264 to mp4 encoding added and some suggestions form hydra3333 included. For example i use now an event object for motion activity that reduces the cpu load to only 24% instead of 66%. There is also ...
by killagreg
Fri Dec 19, 2014 9:39 am
Forum: Camera board
Topic: Lightweight python motion detection
Replies: 259
Views: 281186

Re: Lightweight python motion detection

Nice approach. But the script reduces the image for motion analysis to 340x240 pix independent fom the cam resolution. Hence the crop oft the motion vector array must be scaled according to this ratio. Keep in mind that the 'a'-array in the MyMotionDetector represent the 16x16 pixel macro blocks off...
by killagreg
Wed Dec 17, 2014 10:23 pm
Forum: Camera board
Topic: Lightweight python motion detection
Replies: 259
Views: 281186

Re: Lightweight python motion detection

Hi, inspired by this nice disscussion and code examples I have written a similar script for a surveillance job. It combines also some the advanced techniques of picamera 1.8 into the game. I hope you enjoy that. Regards Greg #!/usr/bin/python # This script implements a motion capture surveillace cam...

Go to advanced search