Motion

From k-space wiki
Revision as of 11:05, 4 February 2019 by Lauri (talk | contribs) (Aggregator)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Streaming on Debian Wheezy (LinuxCNC)

This old version is buggy as hell and config options differ:


 cat << EOF > /etc/motion/motion.conf
 threshold 2147483647
 framerate 15
 webcam_port 8081
 webcam_localhost off
 output_all off
 output_motion off
 width 1280
 height 720
 text_right
 EOF
 echo start_motion_daemon=yes > /etc/default/motion
 /etc/init.d/motion start


Streaming from Raspberry Pi

This disables saving anything locally and makes it behave more or less like mjpg-streamer:

 cat << EOF > /etc/motion/motion.conf
 framerate 15
 stream_port 8081
 stream_maxrate 15
 stream_localhost off
 text_right
 output_pictures off
 width 1280
 height 720
 EOF
 echo start_motion_daemon=yes > /etc/default/motion
 systemctl enable motion
 systemctl start motion


Aggregator

This machine collects individual feeds and does actual motion detection:

 cat << EOF > /etc/motion/motion.conf
 log_level 5
 locate_motion_mode off
 ffmpeg_output_movies on
 ffmpeg_video_codec mp4
 text_double on
 #locate_motion_style redbox
 output_pictures off
 netcam_keepalive off
 netcam_http 1.0
 noise_tune off
 noise_level 50
 threshold 1500
 stream_localhost off
 stream_preview_scale 25
 stream_maxrate 2
 webcontrol_port 8080
 webcontrol_localhost off
 webcontrol_html_output on
 target_dir /srv/@dump/Motion/
 movie_filename %Y/%m/%d/%H-%M-%S-cam%t-ev%v
 framerate 2
 thread /etc/motion/thread1.conf
 thread /etc/motion/thread2.conf
 thread /etc/motion/thread3.conf
 thread /etc/motion/thread11.conf
 thread /etc/motion/thread4.conf
 thread /etc/motion/thread6.conf
 despeckle EedDl
 event_gap 5
 lightswitch 90
 pre_capture 2
 EOF

Individual cam config from OpenWrt running mjpg-streamer:

 cat << EOF > /etc/motion/thread1.conf
 netcam_url http://cam-chaos.sec.k-space.lan:8080/?action=stream
 stream_port 8081
 EOF

Individual cam config streaming from another instance of motion:

 cat << EOF > /etc/motion/thread6.conf
 netcam_url http://linuxcnc.zoo.k-space.lan:8081/
 stream_port 8086
 EOF