I came up with 3 scenario's for motion detection:
1)Do not use motion, but use a raspivid stream over the network and let a powerful server do the motion detection and video encoding (e.g iSpy).
->Problem: constant network bandwith hogging.
2)Use motion and let ffmpeg do the video encoding.
->Problem: CPU can't handle the higher resolutions
3)Use motion, record raw video and let a powerful server do the encoding.
-> CPU usage on RPi is low and network bandwith is limited to when there is actual motion.
For this scenario I am writing first to the SD-card for max throughput and then crontab a copy to the server.
I am using extpipe and I disabled image, ffmpeg and http-streaming outputs.
Code: Select all
# Maximum number of frames to be captured per second. # Valid range: 2-100. Default: 100 (almost no limit). framerate 10 extpipe mencoder -demuxer rawvideo -rawvideo w=640:h=480 -ovc raw -of avi -o %f.avi - -fps 25
Code: Select all
[-1242688672] [NTC] [ALL] motion_startup: Logging to file (/home/pi/motion.log) MEncoder svn r34540 (Debian), built with gcc-4.6 (C) 2000-2012 MPlayer Team Reading from stdin... success: format: 0 data: 0x0 - 0x0 rawvideo file format detected. [V] filefmt:26 fourcc:0x30323449 size:640x480 fps:25.000 ftime:=0.0400 Input fps will be interpreted as 25.000 instead. Opening video filter: [expand osd=1] Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1 ========================================================================== Opening video decoder: [raw] RAW Uncompressed Video Movie-Aspect is undefined - no prescaling applied. Selected video codec: [rawi420] vfm: raw (RAW I420) ========================================================================== Writing header... ODML: vprp aspect is 4:3. Writing header... ODML: vprp aspect is 4:3. Pos: 0.8s 21f ( 0%) 2.42fps Trem: 0min 0mb A-V:0.000 [0:0] Flushing video frames. Writing index... Writing header... ODML: vprp aspect is 4:3. Video stream: 92160.000 kbit/s (11520000 B/s) size: 9216000 bytes 0.800 secs 21 frames
a)I also tried to use the built in ffmpeg instead of extpipe, but it doesn't take the rawvideo codec.
b)Can I launch raspivid when motion is detected?