Motion-Project / motion

Motion, a software motion detector. Home page: https://motion-project.github.io/
GNU General Public License v2.0
3.67k stars 549 forks source link

Motion Is Capturing Video With No Movement #571

Closed wright546 closed 6 years ago

wright546 commented 6 years ago
  1. version [x.y.z, hash, other]: 4.1.1
  2. installed as a package or compiled from sources [deb, rpm, git, other]: Installed from deb
  3. standalone or part of third party [motion, MotionEyeOS, other]: Standalone
  4. video stream source [V4L (card or USB), net cam (mjpeg, rtsp, other), mmal]: USB webcam
  5. hardware [x86, ARM, other]: x86
  6. operating system [Linux (which), FreeBSD, other]: Ubuntu 16.04

Motion was working perfectly before I upgraded Ubuntu. I don't know what version of Motion I was using previously, it would have been whatever the default was in Ubuntu 14. After I upgraded to Ubuntu 16.04 Motion has been recording hours of video of no movement at all and I can't figure out why. Version 3.2.12 did this and I just upgraded to version 4.1.1 and it's still doing it.

At this point I'm at a lost of what else to try. Can anyone offer any suggestions?

Thank you

tosiara commented 6 years ago

Providing config file and log would help us Add locate_motion_mode on to see which areas are triggering motion. Or you can save "debug" movies with ffmpeg_output_debug_movies on. This will give you an idea Also check the config file, you may be using some deprecated options that have been renamed in the newer motion.

wright546 commented 6 years ago

Thanks for the advice, I'm checking into those now. Config and log are below, hopefully they will give some more clues.

Config file:

logfile /home/user/.motion/motion.log
daemon off
process_id_file /var/run/motion/motion.pid
setup_mode off
videodevice /dev/video0
v4l2_palette 2
input -1
norm 0
frequency 0
rotate 0
width 1280
height 1024
framerate 2
minimum_frame_time 0
netcam_tolerant_check off
auto_brightness on
brightness 0
contrast 0
saturation 0
hue 0
roundrobin_frames 1
roundrobin_skip 1
switchfilter off
threshold 15000
threshold_tune on
noise_level 32
noise_tune on
despeckle EedDl
smart_mask_speed 0
lightswitch 90
minimum_motion_frames 5
pre_capture 5
post_capture 5
event_gap 60
max_movie_time 0
emulate_motion off
output_pictures on
output_debug_pictures off
quality 75
ppm off
picture_type jpeg
ffmpeg_output_movies on
ffmpeg_output_debug_movies off
ffmpeg_timelapse 0
ffmpeg_timelapse_mode daily
ffmpeg_bps 500000
ffmpeg_variable_bitrate 0
ffmpeg_video_codec mpeg4
ffmpeg_deinterlace off
snapshot_interval 0
locate off
text_right %Y-%m-%d\n%T-%q
text_changes off
text_event %Y%m%d%H%M%S
text_double off
target_dir /media/gluster/.motion/camera1
snapshot_filename $v-%Y%m%d%H%M%S-snapshot
picture_filename jpeg/%Y-%m-%d-%H-%M-%S-%q
movie_filename %Y-%m-%d-%H-%M-%S
timelapse_filename %Y%m%d-timelapse
stream_port 8081
stream_quality 50
stream_motion off
stream_maxrate 1
stream_localhost off
stream_limit 0
control_port 8080
control_localhost on
control_html_output on
track_type 0
track_auto off
track_motorx 0
track_motory 0
track_maxx 0
track_maxy 0
track_iomojo_id 0
track_step_angle_x 10
track_step_angle_y 10
track_move_wait 10
track_speed 255
track_stepsize 40
quiet on
on_event_start /usr/bin/arecord /media/gluster/.motion/camera1/%Y-%m-%d-%H-%M-%S.wav
on_event_end ps -ef | grep arecord | grep -v grep  | awk '{print $2}' | xargs kill -9
sql_log_image on
sql_log_snapshot on
sql_log_mpeg off
sql_log_timelapse off
sql_query insert into security(camera, filename, frame, file_type, time_stamp, event_time_stamp) values('%t', '%f', '%q', '%n', '%Y-%m-%d %T', '%C')

Log File:

[-674949824:motion] [NTC] [ALL] [Dec 13 10:13:28] motion_startup: Using default log type (ALL)
[-674949824:motion] [NTC] [ALL] [Dec 13 10:13:28] motion_startup: Using log type (ALL) log level (NTC)
[-674949824:motion] [NTC] [ENC] [Dec 13 10:13:28] ffmpeg_global_init: ffmpeg libavcodec version 56.60.100 libavformat version 56.40.101
[0:motion] [NTC] [ALL] [Dec 13 10:13:28] main: Camera ID: 0 is from /home/user/.motion/motion.conf
[0:motion] [NTC] [ALL] [Dec 13 10:13:28] main: Camera ID: 0 Camera Name: (null) Device: /dev/video0
[0:motion] [NTC] [ALL] [Dec 13 10:13:28] main: Waiting for threads to finish, pid: 32311
[1:ml1] [NTC] [ALL] [Dec 13 10:13:28] motion_init: Camera 0 started: motion detection Enabled
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] vid_start: Opening V4L2 device
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_start: Using videodevice /dev/video0 and input -1
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_get_capability:
------------------------
cap.driver: "uvcvideo"
cap.card: "UVC Camera (046d:0990)"
cap.bus_info: "usb-0000:00:1d.7-3"
cap.capabilities=0x84200001
------------------------
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_get_capability: - VIDEO_CAPTURE
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_get_capability: - STREAMING
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_select_input: name = "Camera 1", type 0x00000002, status 00000000
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_select_input: - CAMERA
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_select_input: Device does not support specifying PAL/NTSC norm
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_set_pix_format: Configuration palette index 2 (BA81) doesn't work.
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_set_pix_format: Supported palettes:
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_set_pix_format: (0) MJPG (Motion-JPEG)
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_set_pix_format: 0 - Motion-JPEG (compressed : 1) (0x47504a4d)
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_set_pix_format: (1) YUYV (YUYV 4:2:2)
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_set_pix_format: 1 - YUYV 4:2:2 (compressed : 0) (0x56595559)
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_do_set_pix_format: Testing palette YUYV (1280x1024)
[1:ml1] [WRN] [VID] [Dec 13 10:13:28] v4l2_do_set_pix_format: Adjusting resolution from 1280x1024 to 1600x1200.
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_do_set_pix_format: Using palette YUYV (1600x1200) bytesperlines 3200 sizeimage 3840000 colorspace 00000008
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_set_pix_format: Selected palette YUYV
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_scan_controls: found control 0x00980900, "Brightness", range 0,255
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_scan_controls:       "Brightness", default 128, current 128
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_scan_controls: found control 0x00980901, "Contrast", range 0,255
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_scan_controls:       "Contrast", default 32, current 32
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_scan_controls: found control 0x00980902, "Saturation", range 0,255
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_scan_controls:       "Saturation", default 32, current 32
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_scan_controls: found control 0x00980918, "Power Line Frequency", range 0,2
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_scan_controls:       "Power Line Frequency", default 2, current 2
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_scan_controls: found control 0x00980913, "Gain", range 0,255
[1:ml1] [NTC] [VID] [Dec 13 10:13:28] v4l2_scan_controls:       "Gain", default 0, current 230
[1:ml1] [NTC] [ALL] [Dec 13 10:13:28] image_ring_resize: Resizing pre_capture buffer to 1 items
[1:ml1] [NTC] [STR] [Dec 13 10:13:32] http_bindsock: listening on any IPv4 address port 8081
[1:ml1] [NTC] [ALL] [Dec 13 10:13:32] motion_init: Started motion-stream server on port 8081 (auth Disabled)
[1:ml1] [NTC] [ALL] [Dec 13 10:13:32] image_ring_resize: Resizing pre_capture buffer to 10 items
[1:ml1] [NTC] [ENC] [Dec 13 10:13:38] ffmpeg_set_codec: Low fps. Encoding 2 frames into a 10 frames container.
[1:ml1] [NTC] [EVT] [Dec 13 10:13:38] event_newfile: File of type 8 saved to: /media/gluster/.motion/camera1/2017-12-13-10-13-34.avi
[1:ml1] [NTC] [ALL] [Dec 13 10:13:38] motion_detected: Motion detected - starting event 1
[1:ml1] [NTC] [EVT] [Dec 13 10:13:38] event_newfile: File of type 1 saved to: /media/gluster/.motion/camera1/jpeg/2017-12-13-10-13-34-00.jpg
.
.
.
.
[1:ml1] [NTC] [ALL] [Dec 13 10:14:23] mlp_actions: End of event 1
[1:ml1] [NTC] [EVT] [Dec 13 10:14:23] event_newfile: File of type 1 saved to: /media/gluster/.motion/camera1/jpeg/2017-12-13-10-14-22-01.jpg
[1:ml1] [NTC] [ALL] [Dec 13 10:14:23] motion_loop: Thread exiting
[1:ml1] [NTC] [STR] [Dec 13 10:14:23] stream_stop: Closing motion-stream listen socket & active motion-stream sockets
[1:ml1] [NTC] [STR] [Dec 13 10:14:23] stream_stop: Closed motion-stream listen socket & active motion-stream sockets
[1:ml1] [NTC] [VID] [Dec 13 10:14:23] vid_close: Cleaning up V4L2 device
[1:ml1] [NTC] [VID] [Dec 13 10:14:23] v4l2_cleanup: Closing video device /dev/video0
[0:motion] [NTC] [ALL] [Dec 13 10:14:23] main: Threads finished
[0:motion] [NTC] [ALL] [Dec 13 10:14:24] main: Motion terminating
[0:motion] [NTC] [ALL] [Dec 13 10:14:24] motion_remove_pid: Closing logfile (/home/user/.motion/motion.log).
wright546 commented 6 years ago

I enabled the ffmpeg_output_debug_movies option. It's drawing a square that covers 80-90% of the image, but there is no movement there. The square moves a very little bit and hovers in the upper left corner, leaving about an inch on the bottom and right that is outside the outline.

tosiara commented 6 years ago

Can you provide sample videos (both normal and debug)? If they are too private you can try to reproduce the issue in some similar but neutral area

wright546 commented 6 years ago

Thanks very much for the help This weekend I'll point the camera toward a blank wall and see if I can reproduce the problem. What is the best way to provide the video? Upload them here? I'll keep the filesize as small as I can.

tosiara commented 6 years ago

Probably the best would be to upload it to any personal file share, like Dropbox or Google Drive

wright546 commented 6 years ago

When I point the camera to a wall nearby it does not detect movement or record anything. But when I point it back to the empty room it starts detecting movement again when there is no movement in the room. I have a video file that I will upload to YouTube. Is there a way to private message you the link?

tosiara commented 6 years ago

Get my PGP key: https://api.github.com/users/tosiara/gpg_keys Then: $ echo "https://youtube/blahblah" | gpg --encrypt --armor -r 30E4B487

wright546 commented 6 years ago

Sent. Let me know if you do not receive it. Thanks!

tosiara commented 6 years ago

Paste here the encrypted text :)

wright546 commented 6 years ago

hQEMAzwWtUGzwX+nAQf9GWU8YjuVQLHPM2acmds9NMHhldUCnvIsVVFh8oM8b3j+ rmRisHRdHSEqD5XCS5ag1UZTRSpN28m/28YtRTjv0xtP1FvuV3sWVu8x/dBm8EPn za5PsCBj94z3vpvP26YQAK6CeV3SAJYEakXol93YgnQumnECMA/uHQ+tmPSkD7fI wW5J47hh41hQSKMv+gndEy7KtZCxBnmg6MjiHOYuqkdxRbodoNrMtnCti3OS/PZH cxMsN2BcSR4UjCzpxASfE1Zcum7wmKn+M3RBhG/iKI1RfkoU12PCjeOdyIS/v/Hm XLlXLOjUEThnpNscYgP2pJ2HaCP9Wm4sh373kk7SLNJYAWSNNIZdr7VEB/Z68MYj LoNwlwq4ZsnE77nZqUkZxRWKuq+1B3v8GqeakJW/0/Gbq3IohKdI4ZlcxucGSCU9 W5TB61WrR6l0lpVxDjzyfvYaDy5EZPuDSg== =U4gL

tosiara commented 6 years ago

Ok, I got it You mentioned that the older version worked fine. The picture is of so poor quality. Was the video always such pixelated? Together with low light condition and a led light those pixels are "dancing" and may trigger motion detection Can you try to specify v4l2_palette 8 and again provide motion log?

wright546 commented 6 years ago

I don't think the video was always so pixelated. Do you think Ubuntu might be detecting the camera incorrectly, or possibly using old/bad drivers?

I updated v412_palette to 8 and it still detected movement when there was no movement.

Log file:

[1250628928:motion] [NTC] [ALL] [Dec 19 13:02:31] motion_startup: Using default log type (ALL)
[1250628928:motion] [NTC] [ALL] [Dec 19 13:02:31] motion_startup: Using log type (ALL) log level (NTC)
[1250628928:motion] [NTC] [ENC] [Dec 19 13:02:31] ffmpeg_global_init: ffmpeg libavcodec version 56.60.100 libavformat version 56.40.101
[0:motion] [NTC] [ALL] [Dec 19 13:02:32] main: Camera ID: 0 is from /home/user/.motion/motion.conf
[0:motion] [NTC] [ALL] [Dec 19 13:02:32] main: Camera ID: 0 Camera Name: (null) Device: /dev/video0
[0:motion] [NTC] [ALL] [Dec 19 13:02:32] main: Waiting for threads to finish, pid: 14197
[1:ml1] [NTC] [ALL] [Dec 19 13:02:32] motion_init: Camera 0 started: motion detection Enabled
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] vid_start: Opening V4L2 device
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_start: Using videodevice /dev/video0 and input -1
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_get_capability:
------------------------
cap.driver: "uvcvideo"
cap.card: "UVC Camera (046d:0990)"
cap.bus_info: "usb-0000:00:1d.7-3"
cap.capabilities=0x84200001
------------------------
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_get_capability: - VIDEO_CAPTURE
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_get_capability: - STREAMING
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_select_input: name = "Camera 1", type 0x00000002, status 00000000
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_select_input: - CAMERA
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_select_input: Device does not support specifying PAL/NTSC norm
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_do_set_pix_format: Testing palette MJPG (1024x768)
[1:ml1] [WRN] [VID] [Dec 19 13:02:32] v4l2_do_set_pix_format: Adjusting resolution from 1024x768 to 960x720.
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_do_set_pix_format: Using palette MJPG (960x720) bytesperlines 0 sizeimage 409600 colorspace 00000008
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_scan_controls: found control 0x00980900, "Brightness", range 0,255
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_scan_controls:       "Brightness", default 128, current 128
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_scan_controls: found control 0x00980901, "Contrast", range 0,255
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_scan_controls:       "Contrast", default 32, current 32
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_scan_controls: found control 0x00980902, "Saturation", range 0,255
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_scan_controls:       "Saturation", default 32, current 32
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_scan_controls: found control 0x00980918, "Power Line Frequency", range 0,2
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_scan_controls:       "Power Line Frequency", default 2, current 2
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_scan_controls: found control 0x00980913, "Gain", range 0,255
[1:ml1] [NTC] [VID] [Dec 19 13:02:32] v4l2_scan_controls:       "Gain", default 0, current 232
[1:ml1] [NTC] [ALL] [Dec 19 13:02:32] image_ring_resize: Resizing pre_capture buffer to 1 items
[1:ml1] [NTC] [STR] [Dec 19 13:02:34] http_bindsock: listening on any IPv4 address port 8081
[1:ml1] [NTC] [ALL] [Dec 19 13:02:34] motion_init: Started motion-stream server on port 8081 (auth Disabled)
[1:ml1] [NTC] [ALL] [Dec 19 13:02:34] image_ring_resize: Resizing pre_capture buffer to 10 items
[1:ml1] [NTC] [ENC] [Dec 19 13:02:40] ffmpeg_set_codec: Low fps. Encoding 2 frames into a 10 frames container.
[1:ml1] [NTC] [EVT] [Dec 19 13:02:41] event_newfile: File of type 8 saved to: /media/gluster/.motion/camera1/2017-12-19-13-02-36.avi
[1:ml1] [NTC] [ALL] [Dec 19 13:02:41] motion_detected: Motion detected - starting event 1
[1:ml1] [NTC] [EVT] [Dec 19 13:02:42] event_newfile: File of type 1 saved to: /media/gluster/.motion/camera1/jpeg/2017-12-19-13-02-36-00.jpg
.
.
.
.
[1:ml1] [NTC] [ALL] [Dec 19 13:03:05] mlp_actions: End of event 1
[1:ml1] [NTC] [EVT] [Dec 19 13:03:06] event_newfile: File of type 1 saved to: /media/gluster/.motion/camera1/jpeg/2017-12-19-13-03-05-00.jpg
[1:ml1] [NTC] [ALL] [Dec 19 13:03:06] motion_loop: Thread exiting
[1:ml1] [NTC] [STR] [Dec 19 13:03:06] stream_stop: Closing motion-stream listen socket & active motion-stream sockets
[1:ml1] [NTC] [STR] [Dec 19 13:03:06] stream_stop: Closed motion-stream listen socket & active motion-stream sockets
[1:ml1] [NTC] [VID] [Dec 19 13:03:06] vid_close: Cleaning up V4L2 device
[1:ml1] [NTC] [VID] [Dec 19 13:03:06] v4l2_cleanup: Closing video device /dev/video0
[0:motion] [NTC] [ALL] [Dec 19 13:03:06] main: Threads finished
[0:motion] [NTC] [ALL] [Dec 19 13:03:07] main: Motion terminating
[0:motion] [NTC] [ALL] [Dec 19 13:03:07] motion_remove_pid: Closing logfile (/home/user/.motion/motion.log).
tosiara commented 6 years ago

Ok, one more try. Change those params:

ffmpeg_bps 9999999
framerate 10
ffmpeg_output_debug_movies on

And once again, upload two new files (movie and debug movie)

wright546 commented 6 years ago

It looks like the dancing pixels are triggering it, like you said.

hQEMAzwWtUGzwX+nAQgAqmqmo0D4/8DtTwWnk4a5zd85ppwLogJ15548PoK4uKmW iTuY6Skq0rQMp5MTddo7YHfmKWFLlchJ+YS3FtUxs53WfMcKMsWEx/AmM0U8k1Z6 UaMnV4BSS+w/5t1GBoESrjDWuxf0kiCwmzkWh52Z3z/DX2TNxr0Na9LxXRZMqnS2 M64NOH6m6P5gJYfq4WWW7qorq03cCQp7TykdVu/CBnv/oCDHLWW+10NKrAXstdlu EAwZEQY+pyNk8LZgZTMb7txp8keFNMvh1oEOtgMqseyTQvbeeXqheoXo20zhJh2q 0KuECOhxdcv6f3AcS+LaYTo/esDjWSop+bplb9M+a9JYAZe/9csa8/OCcF4m0e8g Q1HGADq8HJNBCP9l6Vep5kqQLvLiKWQH7/bE1vxSdvfXoB+iPDUNA/KvWVLK7Whg PFEhRngDVNdBf29ZQ3pGKH7QVukF0ytNqw== =1EHn

hQEMAzwWtUGzwX+nAQf/ekmAIFxEzrcSVLm7kMo4vPL0cr7Tp6Fp7zBPYf+HElsp Ogho+QCLZt2wtzKrLgGSrMZ3li+IU0z/NdHwwndEscbAoCJ0VUEK6b8tyhco5Szc I4SPzLxYRHYNHh3Qt56cBip/7karrHSYYp8aVmz/4BfvZSercNdwUu1HeoGf78Ws EMIOtQWeWX7Z0bZVssb60JQVUNdC5q4lMopcx1PKJ3BaxlGG7kF+uYz6lQu4aTT1 +201zJNqgi5WMG2ZNDEReAR/ozz07CfhJQalgqukzeth3QlGkI/p1UkF7b78GPNg wqmXG/C0pxDiOMab4A0gSTnUG5Gi8pR1YYinK8K/P9JYAS5YJwCVtaenjrUpVu50 EGX7ZMojx6tlxqxY0GzzwTZzdyqYmlC/+gd8NqdG82GP2VFlFUHwsJq0rIkSm8i4 gc1YGanGbSBoY67tHOA0AjN2GDsbZE813A== =9P+w

tosiara commented 6 years ago

Yeah, this can be tricky Increasing threshold won't help much as you have pretty large area of false positive motion. Try changing noise_level and different combinations of despeckle_filter and run motion in setup_mode mode to see changing pixels and noise levels You will have to experiment with params or replace the camera

wright546 commented 6 years ago

Do you have a recommended setting to start with for the despeckle option? I've tried multiple different combinations and none of them have seemed to change the image at all.

Also, when I log into the control web page at port 8080 under All->Config->Set, the drop-down box is empty. Is that right? I went through all the menus and that seems to be the only place to change the settings while motion is running.

Mr-Dave commented 6 years ago

Closing. Please check documentation.