Motion Detection



  • Hello!Everyone!
    Someone knows? Why does not the motion detector connect?
    which means, when in conf.json it says in the opencv and motion: pluginkeys
    "change this to some very random"? what kind of key?

    Thanks!


  • administrators

    Anything! Your name, birthday, anything! As long as pluginKey for motion matches the key in plugins/motion/conf.json you are good to go!

    Also be sure to modify plugins/motion/conf.json to have the port match Shinobi's web port. If you are using default ports then leave it as 8080.



  • For me it seems to connect, but where I should find it in UI?

    2017-11-04T10:04:01+02:00 Connected to plugin : Detector - Motion

    Also is it possible to detect motion events from Preview stream and do recording from Main stream?



  • Oh it was found when enabled advanced settings.

    Now trying to get it working. Any hints for settings?
    I'm using h.264 vaapi for Input, HLS copy for stream and copy for record.

    Edit:
    OMG That was super easy to setup motion detector and no need to use Preview stream as it is so low CPU usage with ffmpeg.

    But would it be possible to use hwaccel also for extracting jpeg for motion detector?

    Working

    ffmpeg -loglevel warning -rtsp_transport tcp -hwaccel vaapi -i rtsp://xxxx:[email protected]:554/Streaming/Channels/101 -vcodec copy -r 1 -s 640x480 -f segment -segment_atclocktime 1 -reset_timestamps 1 -strftime 1 -segment_list pipe:2 -segment_time 900 /data2/Shinobi/videos2/V85wc3r/gYn7A95xtD/%Y-%m-%dT%H-%M-%S.mp4 -preset ultrafast -crf 15 -an -c:v copy -r 2 -f hls -s 640x480 -tune zerolatency -g 1 -hls_time 2 -hls_list_size 3 -start_number 0 -hls_allow_cache 0 -hls_flags +delete_segments+omit_endlist /dev/shm/streams/V85wc3r/gYn7A95xtD/s.m3u8 -f singlejpeg -vf fps=2 -s 640x480 pipe:0
    

    Not working

    ffmpeg -loglevel warning -rtsp_transport tcp -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i rtsp://xxxx:[email protected]:554/Streaming/Channels/101 -vcodec copy -r 1 -s 640x480 -f segment -segment_atclocktime 1 -reset_timestamps 1 -strftime 1 -segment_list pipe:2 -segment_time 900 /data2/Shinobi/videos2/V85wc3r/gYn7A95xtD/%Y-%m-%dT%H-%M-%S.mp4 -preset ultrafast -crf 15 -an -c:v copy -r 2 -f hls -s 640x480 -tune zerolatency -g 1 -hls_time 2 -hls_list_size 3 -start_number 0 -hls_allow_cache 0 -hls_flags +delete_segments+omit_endlist /dev/shm/streams/V85wc3r/gYn7A95xtD/s.m3u8 -f singlejpeg -vf fps=2 -s 640x480 pipe:0


  • @bogey said in Motion Detection:

    Oh it was found when enabled advanced settings.

    Now trying to get it working. Any hints for settings?
    I'm using h.264 vaapi for Input, HLS copy for stream and copy for record.

    Edit:
    OMG That was super easy to setup motion detector and no need to use Preview stream as it is so low CPU usage with ffmpeg.

    But would it be possible to use hwaccel also for extracting jpeg for motion detector?

    Working

    ffmpeg -loglevel warning -rtsp_transport tcp -hwaccel vaapi -i rtsp://xxxx:[email protected]:554/Streaming/Channels/101 -vcodec copy -r 1 -s 640x480 -f segment -segment_atclocktime 1 -reset_timestamps 1 -strftime 1 -segment_list pipe:2 -segment_time 900 /data2/Shinobi/videos2/V85wc3r/gYn7A95xtD/%Y-%m-%dT%H-%M-%S.mp4 -preset ultrafast -crf 15 -an -c:v copy -r 2 -f hls -s 640x480 -tune zerolatency -g 1 -hls_time 2 -hls_list_size 3 -start_number 0 -hls_allow_cache 0 -hls_flags +delete_segments+omit_endlist /dev/shm/streams/V85wc3r/gYn7A95xtD/s.m3u8 -f singlejpeg -vf fps=2 -s 640x480 pipe:0
    

    Not working

    ffmpeg -loglevel warning -rtsp_transport tcp -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i rtsp://xxxx:[email protected]:554/Streaming/Channels/101 -vcodec copy -r 1 -s 640x480 -f segment -segment_atclocktime 1 -reset_timestamps 1 -strftime 1 -segment_list pipe:2 -segment_time 900 /data2/Shinobi/videos2/V85wc3r/gYn7A95xtD/%Y-%m-%dT%H-%M-%S.mp4 -preset ultrafast -crf 15 -an -c:v copy -r 2 -f hls -s 640x480 -tune zerolatency -g 1 -hls_time 2 -hls_list_size 3 -start_number 0 -hls_allow_cache 0 -hls_flags +delete_segments+omit_endlist /dev/shm/streams/V85wc3r/gYn7A95xtD/s.m3u8 -f singlejpeg -vf fps=2 -s 640x480 pipe:0
    

    edit2: Answering to myself, I have Haswell what is not supporting
    VAProfileJPEGBaseline : VAEntrypointEncPicture
    It only supports decode

    Something like this could maybe work in Braswell and later
    -r 2 -c:v mjpeg_vaapi -global_quality 90 -f image2

    https://trac.ffmpeg.org/wiki/Hardware/QuickSync

    And sorry to go too technical, I just want to tune myself everything.
    Without any custom parameters h.264 stream with copy mode recording enabled and motion detection all is working very well, only 2% cpu on i3-4150 with one 3Mpix camera (Hikvision DS-2CD2335-FWD-I).


  • administrators

    sweet! sorry i didnt get back to this thread sooner. Glad you got it figured out! 😄 also that is interesting. At the very least decoding with GPU helps a lot. 😄 Cheers! id love to hear more about your findings 🙂



  • @moeiscool Thanks!!! Work's fine!



  • Can I somehow filter videos by motion confidence, so that could search only videos and events with confidence 1000 or more? And do the same in power video viewer.
    Also it would be nice to skip to next / previous event and next / previous video in power viewer (at least in mobile web page it is difficult to click the small circles for events and videos)

    Also if email triggers could be have own indifference value.

    So I would like to have lower like >100 indifference events saved in DB, but then able to filter and email only higher like >500 or >1000.


  • administrators

    At this time there is no querying events by it's details.

    Sure i'll note for my next suggestion sweep. 🙂 Thanks!


 

Looks like your connection to Shinobi Forum was lost, please wait while we try to reconnect.