From: Jean-Yves F. B. <7u...@fr...> - 2006-06-15 17:05:24
|
Debian Sarge Krnl 2.6.15.7 vloopback-0.97-snap2 dev_offset=3D10 pipes=3D2 Philips ToUcam Pro (740K) webcam PWC module V.10.0.11 (NOT form the krnl tree) Carte Noire coffee Deperados beer NO sex until it works (Hurry up folks :) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Hi list, I want to use motion for film survey and I need sound too. I saw that sound will never be implemented, so I wanna use vlc as an A+V recorder (because in case of burglary, sound is very important too). Script# 1 is launching 'feed' to copy the /dev/video0 stream, and launch motion after (and kills 'feed's @ the end). Script# 2 is launching 'vlc' for recording. 'on_event_end' *should* kill vlc, leaving the machine ready for the next detection BUT IT DON'T! I have no clue why. Jen-Yves F. Barbier I joined the conffile & scripts: /etc/motion/motion.conf: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # CONF FILE FOR PHILIPS 740K WEBCAM (ToUcam Pro) # pwc module setup: # alias char-major-81-0 pwc # options pwc size=3Dvga fps=3D15 compression=3D1 \ # leds-0,1000 power_save=3D1 # TIP: In order to switch off the webcam light, call a little script @ # boot that call the caminfo program. #########################################################################= ################################# daemon off quiet on # Device that supplies the images videodevice /dev/video11 # 'input 8' for a webcam input 8 # Norm is PAL norm 0 # Image size width 640 height 480 # Max framerate (usually the webcam's) (default =3D 100 =3D no limit) ###framerate 15 # Quality for JPEG images capture quality 100 # The 740K manage auto-brightness, so don't ask motion to redo it auto_brightness off brightness 0 contrast 0 saturation 0 hue 0 # Encode movies in real-time (install ffmpeg before enabling) ffmpeg_cap_new off # Name of AVI files movie_filename %v--%Y-%m-%d--%H:%M:%S # File rollover of the timelapse video (???? default =3D daily) ffmpeg_timelapse_mode manual # Encoding @ variable speed (2-31 2=3DBEST, 31=3DWORST) ffmpeg_variable_bitrate 2 # Codec to be used by ffmpeg for the video compression. # Supported formats: mpeg4, msmpeg4. # I don't use evil non-open-source shit, so no m$mpeg4 ffmpeg_video_codec mpeg4 # Draw a rectangle upon motion detection zone (default =3D off) (funny) locate off ############################################################## IMPORTANT ### IMPORTANT FOR A GOOD DETECTION !!! # While idle, reduce FPS to this number (! too low: can miss a detection) low_cpu 5 # Number of motion detected fremes BEFORE we start recording (default =3D 1, recommended =3D 1-10) minimum_motion_frames 3 ############################################################# /IMPORTANT # Text displayed on lower right corner # (default =3D %Y-%m-%d\n%T =3D ISO DATE (2006-06-13) + HOUR (17:45:24) + FRAME Nb) text_right %Y-%m-%d--%T-%q # %q add frame number just as a video time code # Write the number of changed pixel on upper right corner (for testing) text_changes on # Double text size (default =3D off) text_double on # Target base directory for pictures and films # You should probably change this (create dir beforehand) #target_dir /NFS/1/FLM/SURVEY target_dir /home/niff # Define a port number (e.g. 8000) to enable the mini-http server # 0 =3D disabled webcam_port 6666 # Set to 'off' to allow anybody (not just localhost) to view the # webcam via the mini-http server (http://hostname:port) webcam_localhost on # Webcam images' quality (not very clear in man) #webcam_quality 50 webcam_quality 100 ###### ??? (default =3D 1) Maximum framerate for WC streams ??? webcam_maxrate 100 # TCP/IP Control port for httpd svr to listen to control_port 8080 # Local control only control_localhost on # Control in HTML control_html_output on # Threshold: Beyond NNNN pixels changed, we start recording (d=E9fault =3D= 1500) threshold 2048 # Noise threshold for motion detection (default =3D 32) noise_level 32 # Automatically tune the noise detection threshold (default =3D on) noise_tune on # Despeckle image unsing erode or dilate or label (default =3D undef) # recommend value =3D EedDl despeckle EedDl # Number of frames to be captured AFTER the END OF DETECTION (default =3D= 0) # 75 frm @ FPS15 <=3D> 5sec more ###post_capture 75 # Number of sec. that triggers the end of an event (AFTER end of detectio= n) gap 3 # Max duration of an MPEG file in sec. (0 =3D infinity, default is 3600) max_mpeg_time 0 # Save images EVEN if NO DETECTION (default =3D off) output_all off # Save images @ DETECTION (default =3D on) output_normal off # ONLY save MOTION PIXELS (default =3D off) output_motion off ##################################################################### # Now, the 2 most important line in order to let vlc do the recording # Command executed @ DETECTION on_event_start /usr/local/bin/WEBCAM-CAPTURE-VIDEO+AUDIO-VLC %Y-%m-%d--%T.avi #on_movie_start '/usr/local/bin/WEBCAM-CAPTURE-VIDEO+AUDIO-VLC %Y-%m-%d--%T.avi' # Command executed AFTER AVI completion on_event_end killall vlc #on_movie_end 'killall vlc' MOTION LAUNCH SCRIPT: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #!/bin/sh eval '/usr/local/bin/feed /dev/video0 /dev/video10 640x480 yuv420p &' eval '/usr/local/bin/feed /dev/video11 /dev/video12 640x480 yuv420p &' motion killall feed VLC LAUNCH SCRIPT: (/usr/local/bin/WEBCAM-CAPTURE-VIDEO+AUDIO-VLC) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #!/bin/sh #########################################################################= ###################### # Script: WEBCAM-CAPTURE-VIDEO+AUDIO-VLC #########################################################################= ###################### # What?: Capture an AVI from a webcam (w/ audio) with VLC # Created: 20060614 # Revision: 0.1 #########################################################################= ###################### # Usage: WEBCAM-CAPTURE-VIDEO+AUDIO-VLC <filename> #########################################################################= ###################### # PARAMETERS (same name as vlc parms but full caps) DEVICE=3D"v4l" # As we use vloopback with an offset of 10, /dev/video0 becomes /dev/vide= o11 #VLOOPBACK_IN=3D"/dev/video0" #VLOOPBACK_OUT=3D"/dev/video10" # v4l edvice from which we grab video VDEV=3D"/dev/video13" #NORM=3D"3" CHANNEL=3D"0" ADEV=3D"/dev/dsp1" AUDIO=3D"1" VCODEC=3D"mp4v" VB=3D"2048" SCALE=3D"1" ACODEC=3D"mpga" AB=3D"64" CHANNELS=3D"1" ACCESS=3D"file" MUX=3D"ts" ############################################################### PART1=3D"vlc -v $DEVICE:$VDEV:channel=3D$CHANNEL:adev=3D$ADEV:audio=3D$AU= DIO --sout " PART2=3D"#transcode{vcodec=3D$VCODEC,vb=3D$VB,scale=3D$SCALE,acodec=3D$AC= ODEC,ab=3D$AB,channels=3D$CHANNELS}:std{access=3D$ACCESS,mux=3D$MUX,url=3D= $1}" COMMAND_LINE=3D$PART1"'"$PART2"'" eval $COMMAND_LINE exit 0 |