Send Motion-user mailing list submissions to
        motion-user@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/motion-user
or, via email, send a message with subject or body 'help' to
        motion-user-requ...@lists.sourceforge.net

You can reach the person managing the list at
        motion-user-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."


Today's Topics:

   1. Re: some comments on motion detection (William B. Clay)
   2. newbie problems (vector457)


----------------------------------------------------------------------

Message: 1
Date: Sun, 9 Jun 2019 21:53:40 +0200
From: "William B. Clay" <william.b.c...@acm.org>
To: tosiara <tosi...@gmail.com>
Cc: Motion discussion list <motion-user@lists.sourceforge.net>, Graham
        Toal <gt...@gtoal.com>
Subject: Re: [Motion-user] some comments on motion detection
Message-ID: <f02f6b14-b95b-0974-d756-22debcebb...@acm.org>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Re. supplementing motion's image-based motion detection with external 
sensor detection.

On 6/7/19 5:02 PM, tosiara wrote:
> Some of your concens may be addressed as soon as MrDave is back to 
> development:
> https://github.com/Motion-Project/motion/issues/941
> With motion detection moved into a library with API, you will be able
> to "plug" better detector, either physical PIR or software AI
>
> On Thu, Jun 6, 2019 at 9:16 AM Graham Toal <gt...@gtoal.com> wrote:
>> Hi - I've been using motion on raspberry pies for a few years now.
>>
>> I have some thoughts I'ld like to pass on.  Motion's detection has too many 
>> false positives for my liking, and the offered solutions haven't ever really 
>> fixed it for me.  So...
>>
>> ...
>>
>> 3) Could there be a mechanism to add some external trigger to supplement the 
>> motion detection, eg a PIR sensor or radar sensor - and have motion handle 
>> the video only if it detects motion in the video *and* the external trigger 
>> also has detected motion?  (and some users might want the option of "OR" 
>> rather than "AND" depending on their tolerance of false positives)
>>
>> ...

I have been doing this for more than 6 years to deal with sudden changes 
in room illumination coming from outdoors (the "light switch" feature 
didn't do the job for me).

Comment summary of the changes to motion.c is:

external alarm function, logically "ored" w/ video motion detection
memory-mapped file /<pidfile dir>/mdT.mmap (T=thread no.), containing
a 1-char alarm status plus \0 terminator.? file must be dynamically
updated by separate program.? alarm status may be included in
event string formats as substitution symbol "%!" for values:
* "-" motion access to memory-mapped file failed (see log at startup)
* "0" external alarm program inactive or not implemented
* "1" external alarm program operational, but no alarm signalled
* "2" external alarm signalled (only value significant to this module)
* "3" external alarm fault (as determined by external alarm program)

I'm using a Phidgets, Inc. (https://www.phidgets.com/) USB sensor device 
to read PIR contact closure, controlled by a Python program using 
Phidgets' Python API (one of several languages they support). With 
careful coding for opening and initialization of the memory-mapped file, 
I have had totally reliable operation regardless of which side starts 
first or is restarted. Unfortunately, my code is based on motion 3.2.12 
as of June 2010 and is accompanied by other fairly extensive mods, so I 
doubt it could be easily ported to the latest and greatest motion.

Be glad to share if anyone is interested in trying.? FYI, functions of 
the other mods are:

1. Asynchronous DB transactions, so motion doesn't miss frames waiting 
for a remote DB commit.? Useful for rapid off-site logging of motion 
events; I presume competent burglars will snag the motion server within 
1 minute of a break-in.

2. Prepared SQL statements and binary transmission to minimize DB 
session bandwidth and load.

3. An on_event_end_sql option plus several new mystrftime() substitution 
symbols to allow shell or SQL stored procedures to figure out what to do 
with motion vs. PIR alarms.

4. Change on_camera_lost event to on_camera_change (loss/gain/stop) and 
add an on_camera_change_sql option to allow camera loss to be logged 
and/or begin and terminate automatic recovery (e.g., bouncing power to 
the camera, possibly more than once).

5. Multiple SQL statements per camera thread (presently 3: new 
image/video file, camera acquired/lost/stopped, motion event end/summary).

Most DB-related mods are implemented only for PostgreSQL.

Contact me off list if you want the code ...

-- Bill Clay

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 2
Date: Mon, 10 Jun 2019 18:47:55 +1000
From: vector457 <vector...@gmail.com>
To: motion-user@lists.sourceforge.net
Subject: [Motion-user] newbie problems
Message-ID: <97157319-a699-dcc9-d336-aaa86acb5...@gmail.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Hi all,

installed motion on Ubuntu18

I can see both of my two network cameras using VLC. they are old cams 
but working.

I have attached copy of motion.conf

rtsp://user:password@10.0.0.78/11 {tenvis 1p391w or similar(no further 
info)camera}

rtsp://user:password@10.0.0.90/onvif1?? {sricam SP007 or similar(no 
further info on it)camera}

I used camera1-dist.conf file for both, modifying name ,id and netcam url

to create camera1.conf and camera2.conf.

Problem 1 no local host view.

I ran,mark@fatcat:~$ motion

/[0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file 
/etc/motion/motion.conf
[0:motion] [NTC] [ALL] config_camera: Processing camera config file 
/etc/motion/camera1.conf
[0:motion] [NTC] [ALL] motion_startup: Logging to syslog
[0:motion] [NTC] [ALL] motion_startup: Motion 4.2.2 Started
[0:motion] [NTC] [ALL] motion_startup: Using default log type (ALL)
[0:motion] [NTC] [ALL] motion_startup: Using log type (ALL) log level (NTC)
[0:motion] [NTC] [STR] webu_start_strm: Starting all camera streams on 
port 8081
[0:motion] [NTC] [STR] webu_start_strm: Unable to start stream for camera 0
[0:motion] [NTC] [STR] webu_start_ctrl: Starting webcontrol on port 8080
[0:motion] [NTC] [STR] webu_start_ctrl: Unable to start MHD
[0:motion] [NTC] [ENC] ffmpeg_global_init: ffmpeg libavcodec version 
57.107.100 libavformat version 57.83.100
[0:motion] [NTC] [ALL] translate_init: Language: English
[0:motion] [NTC] [ALL] motion_start_thread: Camera ID: 101 is from 
/etc/motion/camera1.conf
[0:motion] [NTC] [ALL] motion_start_thread: Camera ID: 101 Camera Name: 
MyCam1 Service: rtsp:
[0:motion] [NTC] [ALL] main: Waiting for threads to finish, pid: 21036
[1:ml1:MyCam1] [NTC] [ALL] motion_init: Camera 101 started: motion 
detection Enabled
[1:ml1:MyCam1] [NTC] [VID] vid_start: Opening Netcam RTSP
[1:ml1:MyCam1] [NTC] [NET] netcam_rtsp_connect: Normal resolution: 
Camera (MyCam1) connected
[1:ml1:MyCam1] [NTC] [ALL] image_ring_resize: Resizing pre_capture 
buffer to 1 items
[2:nc2:MyCam1] [NTC] [NET] netcam_rtsp_handler: Normal resolution: 
Camera handler thread [2] started
[2:nc2:MyCam1] [NTC] [NET] netcam_rtsp_connect: Normal resolution: 
Camera (MyCam1) connected
[1:ml1:MyCam1] [NTC] [ALL] image_ring_resize: Resizing pre_capture 
buffer to 4 items
[1:ml1:MyCam1] [NTC] [EVT] event_newfile: File of type 8 saved to: 
./CAM01_101-01-20190610181942.mkv
/

The mkv is indeed in my local dir and is capturing images as expected. 
But yet when I go to web browser(firefox) localhost:8080 it says no 
cameras running. I expected to see a live view?

Problem 2

camera 2 the onvif1 errors with

/Unable to open camera(MyCam2): Invalid data found when processing input
/not sure why its works from this url in VLC.


thoughts?

-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
# Rename this distribution example file to motion.conf
#
# This config file was generated by motion 4.2.2
# Documentation:  /usr/share/doc/motion/motion_guide.html
#
# This file contains only the basic configuration options to get a
# system working.  There are many more options available.  Please
# consult the documentation for the complete list of all options.
#

############################################################
# System control configuration parameters
############################################################

# Start in daemon (background) mode and release terminal.
daemon off

# Start in Setup-Mode, daemon disabled.
setup_mode off

# File to store the process ID.
; pid_file value

# File to write logs messages into.  If not defined stderr and syslog is used.
; log_file value

# Level of log messages [1..9] (EMG, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL).
log_level 6

# Target directory for pictures, snapshots and movies
; target_dir value

# Video device (e.g. /dev/video0) to be used for capturing.
;videodevice /dev/video0

# Parameters to control video device.  See motion_guide.html
; vid_control_params value

# The full URL of the network camera stream.
; netcam_url value 

# Name of mmal camera (e.g. vc.ril.camera for pi camera).
; mmalcam_name value

# Camera control parameters (see raspivid/raspistill tool documentation)
; mmalcam_control_params value

############################################################
# Image Processing configuration parameters
############################################################

# Image width in pixels.
width 640

# Image height in pixels.
height 480

# Maximum number of frames to be captured per second.
framerate 15

# Text to be overlayed in the lower left corner of images
text_left vanCam

# Text to be overlayed in the lower right corner of images.
text_right %Y-%m-%d\n%T-%q

############################################################
# Motion detection configuration parameters
############################################################

# Always save pictures and movies even if there was no motion.
emulate_motion off

# Threshold for number of changed pixels that triggers motion.
threshold 1500

# Noise threshold for the motion detection.
; noise_level 32

# Despeckle the image using (E/e)rode or (D/d)ilate or (l)abel.
despeckle_filter EedDl

# Number of images that must contain motion to trigger an event.
minimum_motion_frames 1

# Gap in seconds of no motion detected that triggers the end of an event.
event_gap 60

# The number of pre-captured (buffered) pictures from before motion.
pre_capture 3

# Number of frames to capture after motion is no longer detected.
post_capture 0

############################################################
# Script execution configuration parameters
############################################################

# Command to be executed when an event starts.
; on_event_start value

# Command to be executed when an event ends.
; on_event_end value

# Command to be executed when a movie file is closed.
; on_movie_end value

############################################################
# Picture output configuration parameters
############################################################

# Output pictures when motion is detected
picture_output off

# File name(without extension) for pictures relative to target directory
picture_filename %Y%m%d%H%M%S-%q

############################################################
# Movie output configuration parameters
############################################################

# Create movies of motion events.
movie_output on

# Maximum length of movie in seconds.
movie_max_time 60

# The encoding quality of the movie. (0=use bitrate. 1=worst quality, 100=best)
movie_quality 45

# Container/Codec to used for the movie. See motion_guide.html
movie_codec mkv

# File name(without extension) for movies relative to target directory
movie_filename %t-%v-%Y%m%d%H%M%S

############################################################
# Webcontrol configuration parameters
############################################################

# Port number used for the webcontrol.
webcontrol_port 8080

# Restrict webcontrol connections to the localhost.
webcontrol_localhost on

# Type of configuration options to allow via the webcontrol.
webcontrol_parms 0

############################################################
# Live stream configuration parameters
############################################################

# The port number for the live stream.
stream_port 8081

# Restrict stream connections to the localhost.
stream_localhost on

##############################################################
# Camera config files - One for each camera.
##############################################################
camera /etc/motion/camera1.conf
;camera /etc/motion/camera2.conf
; camera /etc/motion/camera3.conf
; camera /etc/motion/camera4.conf

##############################################################
# Directory to read '.conf' files for cameras.
##############################################################
; camera_dir /etc/motion/conf.d

------------------------------



------------------------------

Subject: Digest Footer

_______________________________________________
Motion-user mailing list
Motion-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/motion-user


------------------------------

End of Motion-user Digest, Vol 156, Issue 16
********************************************

Reply via email to