Désolé de déterrer un sujet qui semble être déjà vu partout ; mais je n'arrive pas à trouver une solution simple.
Je souhaite surveiller des caméras IP avec un Pi et motion. Je n'y suis jamais arrivé malgré les différentes tentatives et configs (caméras de marques différente, Pi2, Pi3..., Wheezy, Jessy... ; rien n'y fait..)
Mon lien direct vers les snapshots marche en console ou dans des navigateurs.
Je ne mets rien derrière vers videodevice puisque la caméra n'est pas dans /dev
Beaucoup de choses reste par défaut....
Et soit "unable to connect to device", soit "Failed to read first camera header..." et une image grise dans les photos...
J'installe et configure motion comme suit :
Code : Tout sélectionner
# Start in daemon (background) mode and release terminal (default: off)
daemon off
process_id_file /var/run/motion/motion.pid
setup_mode off
log_level 7
log_type all
# Videodevice to be used for capturing (default /dev/video0)
videodevice
# v4l2_palette allows to choose preferable palette to be use by motion
# to capture from those supported by your videodevice. (default: 17)
v4l2_palette 17
# The video input to be used (default: -1)
input -1
# The video norm to use (only for video capture and TV tuner cards)
norm 0
frequency 0
rotate 0
width 640
height 480
framerate 4
minimum_frame_time 0
netcam_url http://admin:password@192.168.1.169:8080/snapshot.jpg
#netcam_userpass admin:password
netcam_keepalive on
netcam_tolerant_check on
auto_brightness off
brightness 0
contrast 0
saturation 0
hue 0
mmalcam_control_params --exposure night
mmalcam_use_still off
mmalcam_secondary_buffer_upscale 4
mmalcam_secondary_buffer_jpeg 50
roundrobin_frames 1
roundrobin_skip 1
switchfilter off
threshold 5000
threshold_tune off
noise_level 32
noise_tune on
despeckle_filter EedDl
area_detect value 5
smart_mask_speed 0
lightswitch 25
minimum_motion_frames 5
pre_capture 1
post_capture 2
event_gap 10
max_movie_time 0
emulate_motion off
# Image File Output
output_pictures best
output_debug_pictures off
output_secondary_pictures on
output_both_pictures on
quality 80
picture_type jpeg
ffmpeg_output_movies off
ffmpeg_output_debug_movies off
ffmpeg_output_secondary_movies off
ffmpeg_timelapse 0
ffmpeg_timelapse_mode daily
ffmpeg_bps 500000
ffmpeg_variable_bitrate 10
ffmpeg_video_codec mpeg4
use_extpipe off
extpipe_secondary on
extpipe mencoder -demuxer rawvideo -rawvideo w=1280:h=960:i420 -ovc x264 -x264encopts bframes=4:frameref=1:subq=1:scenecut=-1:nob_adapt:threads=1:keyint=1000:8x8dct:vbv_bufsize=4000:crf=24:partitions=i8x8,i4x4:vbv_maxrate=800:no-chroma-me -of avi -o %f.avi - -fps %fps
snapshot_interval 5
locate_motion_mode off
locate_motion_style redbox
text_right %Y-%m-%d\n%T-%q
text_changes on
text_event %Y%m%d%H%M%S
text_double off
exif_text "Test exif"
target_dir /media/pi/16GO/ST_cam
snapshot_filename snapshot
picture_filename %v-%Y%m%d%H%M%S-%q
movie_filename movie %Y%m
timelapse_filename %Y%m%d-timelapse
ipv6_enabled off
stream_port 8081
stream_quality 50
stream_motion off
stream_secondary off
stream_maxrate 4
stream_localhost off
stream_limit 0
stream_auth_method 0
webcontrol_port 8080
webcontrol_localhost off
webcontrol_html_output on
track_type 0
track_auto off
track_step_angle_x 10
track_step_angle_y 10
track_move_wait 10
track_speed 255
track_stepsize 40