Motion-Project / motionplus

MotionPlus Home Page: https://motion-project.github.io/
GNU General Public License v3.0
319 stars 40 forks source link

Motionplus exits and writes 0 byte snapshot file #76

Closed CRCinAU closed 1 year ago

CRCinAU commented 1 year ago

Did you read the guide?

Yes

What is the base version number of MotionPlus being used?

0.1.x

What was the install method?

Built from source code

What is base architecture?

ARM-64bit

What is the distro being used?

Ubuntu

Disto version number

No response

Camera/Sound type(s) being used?

Network camera with RTSP

Describe the issue/problem and steps to reproduce

When running, Motionplus will exit at this point of the log. A zero byte snapshot file is written to /tmp/cameras/, and no further output is written to the log, or to /tmp/cameras/

I have played with both the framerates, and disabling the scripts for event & picture write with no luck.

Relevant MotionPlus log output (at log_level 8)

[NTC][ALL][00:motionplus] conf_process: Processing config file /usr/local/etc/motionplus/motionplus.conf
[NTC][ALL][00:motionplus] conf_parm_config_dir: Processing as camera config file /usr/local/etc/motionplus/conf.d/front_door.conf
[NTC][ALL][00:motionplus] conf_process: Processing config file /usr/local/etc/motionplus/conf.d/front_door.conf
[NTC][ALL][00:motionplus] log_init: Logging to syslog
[NTC][ALL][00:motionplus] log_init: MotionPlus 0.1.1 started
[NTC][ALL][00:motionplus] log_init: Using log type (ALL) log level (ALL)
[NTC][ALL][00:motionplus] mytranslate_init: Language: English
[INF][ALL][00:motionplus] conf_parms_log: Logging configuration parameters from all files
[INF][ALL][00:motionplus] Config file: /usr/local/etc/motionplus/motionplus.conf
[INF][ALL][00:motionplus] daemon                    off
[INF][ALL][00:motionplus] setup_mode                off
[INF][ALL][00:motionplus] pid_file                  
[INF][ALL][00:motionplus] log_file                  
[INF][ALL][00:motionplus] log_level                 9
[INF][ALL][00:motionplus] log_type                  ALL
[INF][ALL][00:motionplus] native_language           on
[INF][ALL][00:motionplus] device_name               
[INF][ALL][00:motionplus] device_id                 0
[INF][ALL][00:motionplus] device_tmo                30
[INF][ALL][00:motionplus] pause                     off
[INF][ALL][00:motionplus] target_dir                .
[INF][ALL][00:motionplus] watchdog_tmo              30
[INF][ALL][00:motionplus] watchdog_kill             10
[INF][ALL][00:motionplus] v4l2_device               
[INF][ALL][00:motionplus] v4l2_params               
[INF][ALL][00:motionplus] netcam_url                <redacted>
[INF][ALL][00:motionplus] netcam_params             
[INF][ALL][00:motionplus] netcam_high_url           <redacted>
[INF][ALL][00:motionplus] netcam_high_params        
[INF][ALL][00:motionplus] netcam_userpass           <redacted>
[INF][ALL][00:motionplus] libcam_device             
[INF][ALL][00:motionplus] libcam_params             
[INF][ALL][00:motionplus] width                     640
[INF][ALL][00:motionplus] height                    480
[INF][ALL][00:motionplus] framerate                 15
[INF][ALL][00:motionplus] rotate                    0
[INF][ALL][00:motionplus] flip_axis                 none
[INF][ALL][00:motionplus] locate_motion_mode        off
[INF][ALL][00:motionplus] locate_motion_style       box
[INF][ALL][00:motionplus] text_left                 
[INF][ALL][00:motionplus] text_right                %Y-%m-%d\n%T
[INF][ALL][00:motionplus] text_changes              off
[INF][ALL][00:motionplus] text_scale                1
[INF][ALL][00:motionplus] text_event                %Y%m%d%H%M%S
[INF][ALL][00:motionplus] emulate_motion            off
[INF][ALL][00:motionplus] threshold                 1500
[INF][ALL][00:motionplus] threshold_maximum         0
[INF][ALL][00:motionplus] threshold_sdevx           0
[INF][ALL][00:motionplus] threshold_sdevy           0
[INF][ALL][00:motionplus] threshold_sdevxy          0
[INF][ALL][00:motionplus] threshold_ratio           0
[INF][ALL][00:motionplus] threshold_ratio_change    64
[INF][ALL][00:motionplus] threshold_tune            off
[INF][ALL][00:motionplus] secondary_method          none
[INF][ALL][00:motionplus] secondary_params          
[INF][ALL][00:motionplus] noise_level               32
[INF][ALL][00:motionplus] noise_tune                on
[INF][ALL][00:motionplus] despeckle_filter          
[INF][ALL][00:motionplus] area_detect               
[INF][ALL][00:motionplus] mask_file                 
[INF][ALL][00:motionplus] mask_privacy              
[INF][ALL][00:motionplus] smart_mask_speed          0
[INF][ALL][00:motionplus] lightswitch_percent       0
[INF][ALL][00:motionplus] lightswitch_frames        5
[INF][ALL][00:motionplus] minimum_motion_frames     1
[INF][ALL][00:motionplus] static_object_time        10
[INF][ALL][00:motionplus] event_gap                 60
[INF][ALL][00:motionplus] pre_capture               0
[INF][ALL][00:motionplus] post_capture              0
[INF][ALL][00:motionplus] on_event_start            
[INF][ALL][00:motionplus] on_event_end              
[INF][ALL][00:motionplus] on_picture_save           
[INF][ALL][00:motionplus] on_area_detected          
[INF][ALL][00:motionplus] on_motion_detected        
[INF][ALL][00:motionplus] on_movie_start            
[INF][ALL][00:motionplus] on_movie_end              
[INF][ALL][00:motionplus] on_camera_lost            
[INF][ALL][00:motionplus] on_camera_found           
[INF][ALL][00:motionplus] on_secondary_detect       
[INF][ALL][00:motionplus] on_action_user            
[INF][ALL][00:motionplus] on_sound_alert            
[INF][ALL][00:motionplus] picture_output            off
[INF][ALL][00:motionplus] picture_output_motion     off
[INF][ALL][00:motionplus] picture_type              jpeg
[INF][ALL][00:motionplus] picture_quality           75
[INF][ALL][00:motionplus] picture_exif              
[INF][ALL][00:motionplus] picture_filename          %v-%Y%m%d%H%M%S-%q
[INF][ALL][00:motionplus] snapshot_interval         0
[INF][ALL][00:motionplus] snapshot_filename         %v-%Y%m%d%H%M%S-snapshot
[INF][ALL][00:motionplus] movie_output              on
[INF][ALL][00:motionplus] movie_output_motion       off
[INF][ALL][00:motionplus] movie_max_time            120
[INF][ALL][00:motionplus] movie_bps                 400000
[INF][ALL][00:motionplus] movie_quality             60
[INF][ALL][00:motionplus] movie_container           mkv
[INF][ALL][00:motionplus] movie_passthrough         off
[INF][ALL][00:motionplus] movie_filename            %v-%Y%m%d%H%M%S
[INF][ALL][00:motionplus] movie_retain              all
[INF][ALL][00:motionplus] movie_extpipe_use         off
[INF][ALL][00:motionplus] movie_extpipe             
[INF][ALL][00:motionplus] timelapse_interval        0
[INF][ALL][00:motionplus] timelapse_mode            daily
[INF][ALL][00:motionplus] timelapse_fps             30
[INF][ALL][00:motionplus] timelapse_container       mpg
[INF][ALL][00:motionplus] timelapse_filename        %Y%m%d-timelapse
[INF][ALL][00:motionplus] video_pipe                
[INF][ALL][00:motionplus] video_pipe_motion         
[INF][ALL][00:motionplus] webcontrol_port           8080
[INF][ALL][00:motionplus] webcontrol_base_path      
[INF][ALL][00:motionplus] webcontrol_ipv6           off
[INF][ALL][00:motionplus] webcontrol_localhost      off
[INF][ALL][00:motionplus] webcontrol_parms          0
[INF][ALL][00:motionplus] webcontrol_interface      default
[INF][ALL][00:motionplus] webcontrol_auth_method    none
[INF][ALL][00:motionplus] webcontrol_authentication <redacted>
[INF][ALL][00:motionplus] webcontrol_tls            off
[INF][ALL][00:motionplus] webcontrol_cert           <redacted>
[INF][ALL][00:motionplus] webcontrol_key            <redacted>
[INF][ALL][00:motionplus] webcontrol_headers        
[INF][ALL][00:motionplus] webcontrol_html           
[INF][ALL][00:motionplus] webcontrol_actions        
[INF][ALL][00:motionplus] webcontrol_lock_minutes   10
[INF][ALL][00:motionplus] webcontrol_lock_attempts  3
[INF][ALL][00:motionplus] stream_preview_scale      25
[INF][ALL][00:motionplus] stream_preview_newline    off
[INF][ALL][00:motionplus] stream_preview_method     mjpg
[INF][ALL][00:motionplus] stream_preview_ptz        on
[INF][ALL][00:motionplus] stream_quality            50
[INF][ALL][00:motionplus] stream_grey               off
[INF][ALL][00:motionplus] stream_motion             off
[INF][ALL][00:motionplus] stream_maxrate            1
[INF][ALL][00:motionplus] stream_scan_time          5
[INF][ALL][00:motionplus] stream_scan_scale         25
[INF][ALL][00:motionplus] database_type             
[INF][ALL][00:motionplus] database_dbname           
[INF][ALL][00:motionplus] database_host             
[INF][ALL][00:motionplus] database_port             0
[INF][ALL][00:motionplus] database_user             <redacted>
[INF][ALL][00:motionplus] database_password         <redacted>
[INF][ALL][00:motionplus] database_busy_timeout     0
[INF][ALL][00:motionplus] sql_event_start           
[INF][ALL][00:motionplus] sql_event_end             
[INF][ALL][00:motionplus] sql_movie_start           
[INF][ALL][00:motionplus] sql_movie_end             
[INF][ALL][00:motionplus] sql_pic_save              
[INF][ALL][00:motionplus] ptz_auto_track            off
[INF][ALL][00:motionplus] ptz_wait                  0
[INF][ALL][00:motionplus] ptz_move_track            
[INF][ALL][00:motionplus] ptz_pan_left              
[INF][ALL][00:motionplus] ptz_pan_right             
[INF][ALL][00:motionplus] ptz_tilt_up               
[INF][ALL][00:motionplus] ptz_tilt_down             
[INF][ALL][00:motionplus] ptz_zoom_in               
[INF][ALL][00:motionplus] ptz_zoom_out              
[INF][ALL][00:motionplus] snd_device                
[INF][ALL][00:motionplus] snd_params                
[INF][ALL][00:motionplus] snd_window                hamming
[INF][ALL][00:motionplus] snd_show                  off
[INF][ALL][00:motionplus] Camera 1 - Config file: /usr/local/etc/motionplus/conf.d/front_door.conf
[INF][ALL][00:motionplus] device_name               Front Door
[INF][ALL][00:motionplus] device_id                 1
[INF][ALL][00:motionplus] target_dir                /tmp/cameras
[INF][ALL][00:motionplus] netcam_url                <redacted>
[INF][ALL][00:motionplus] netcam_params             framerate=30,capture_rate=30
[INF][ALL][00:motionplus] netcam_high_url           <redacted>
[INF][ALL][00:motionplus] netcam_high_params        framerate=15,capture_rate=15
[INF][ALL][00:motionplus] netcam_userpass           <redacted>
[INF][ALL][00:motionplus] width                     896
[INF][ALL][00:motionplus] height                    672
[INF][ALL][00:motionplus] threshold                 300
[INF][ALL][00:motionplus] threshold_tune            on
[INF][ALL][00:motionplus] noise_level               45
[INF][ALL][00:motionplus] smart_mask_speed          6
[INF][ALL][00:motionplus] event_gap                 5
[INF][ALL][00:motionplus] on_event_start            /usr/local/etc/motionplus/nodered-cam1-on.sh
[INF][ALL][00:motionplus] on_event_end              /usr/local/etc/motionplus/nodered-cam1-off.sh
[INF][ALL][00:motionplus] on_picture_save           /usr/local/etc/motionplus/nodered-cam1-process.sh
[INF][ALL][00:motionplus] snapshot_interval         1
[INF][ALL][00:motionplus] snapshot_filename         %Y%m%d%H%M%S-%q
[INF][ALL][00:motionplus] movie_output              off
[DBG][ALL][00:motionplus] motpls_ntc: v4l2   : not available
[DBG][ALL][00:motionplus] motpls_ntc: webp   : not available
[DBG][ALL][00:motionplus] motpls_ntc: libcam : not available
[DBG][ALL][00:motionplus] motpls_ntc: mysql  : not available
[DBG][ALL][00:motionplus] motpls_ntc: MariaDB: not available
[DBG][ALL][00:motionplus] motpls_ntc: sqlite3: not available
[DBG][ALL][00:motionplus] motpls_ntc: pgsql  : not available
[DBG][ALL][00:motionplus] motpls_ntc: nls    : available
[DBG][ALL][00:motionplus] motpls_ntc: alsa   : not available
[DBG][ALL][00:motionplus] motpls_ntc: fftw3  : not available
[NTC][STR][00:motionplus] webu_init_webcontrol: Starting webcontrol on port 8080
[INF][ALL][00:motionplus] util_parms_add: Parsed: >event< >off<
[INF][ALL][00:motionplus] util_parms_add: Parsed: >snapshot< >off<
[INF][ALL][00:motionplus] util_parms_add: Parsed: >pause< >off<
[INF][ALL][00:motionplus] util_parms_add: Parsed: >restart< >off<
[INF][ALL][00:motionplus] util_parms_add: Parsed: >stop< >off<
[INF][ALL][00:motionplus] util_parms_add: Parsed: >config_write< >off<
[INF][ALL][00:motionplus] util_parms_add: Parsed: >camera_add< >off<
[INF][ALL][00:motionplus] util_parms_add: Parsed: >camera_delete< >off<
[INF][ALL][00:motionplus] util_parms_add: Parsed: >config< >off<
[INF][ALL][00:motionplus] util_parms_add: Parsed: >ptz< >off<
[INF][ALL][00:motionplus] util_parms_add: Parsed: >movies< >on<
[INF][ALL][00:motionplus] util_parms_add: Parsed: >action_user< >off<
[DBG][STR][00:motionplus] webu_mhd_features_basic: Basic authentication: available
[DBG][STR][00:motionplus] webu_mhd_features_digest: Digest authentication: available
[DBG][STR][00:motionplus] webu_mhd_features_ipv6: IPV6: available
[DBG][STR][00:motionplus] webu_mhd_features_tls: SSL/TLS: available
[NTC][STR][00:motionplus] webu_init_webcontrol: Started webcontrol on port 8080
[NTC][ENC][00:motionplus] movie_global_init: libavcodec  version 60.3.100
[NTC][ENC][00:motionplus] movie_global_init: libavformat version 60.3.100
[NTC][ALL][00:motionplus] main: Motionplus pid: 1
[INF][ALL][00:ml00:Front Door] mlp_init: Initialize
[NTC][VID][00:ml00:Front Door] netcam_start: Opening Netcam
[INF][ALL][00:ml00:Front Door] util_parms_parse: Starting parsing parameters
[DBG][ALL][00:ml00:Front Door] util_parms_parse_comma: Parsing: >framerate=30,capture_rate=30< >0 8 10 11<
[INF][ALL][00:ml00:Front Door] util_parms_add: Parsed: >framerate< >30<
[DBG][ALL][00:ml00:Front Door] util_parms_parse_comma: Parsing: >capture_rate=30< >0 11 13 14<
[INF][ALL][00:ml00:Front Door] util_parms_add: Parsed: >capture_rate< >30<
[INF][NET][00:ml00:Front Door] netcam_set_parms: Norm: Setting up camera.
[INF][ALL][00:ml00:Front Door] util_parms_add: Parsed: >decoder< >NULL<
[INF][NET][00:ml00:Front Door] netcam_url_parse: Using port number 1935
[INF][NET][00:ml00:Front Door] netcam_set_path: Setting up rtmp 
[INF][NET][00:ml00:Front Door] netcam_set_options: Norm: Setting rtsp/rtmp
[INF][ALL][00:ml00:Front Door] util_parms_add: Parsed: >rtsp_transport< >tcp<
[INF][NET][00:ml00:Front Door] netcam_set_options: Norm: option: framerate = 30
[INF][NET][00:ml00:Front Door] netcam_set_options: Norm: option: rtsp_transport = tcp
[INF][NET][00:ml00:Front Door] netcam_open_context: Norm: Opened camera(Front Door)
[INF][NET][00:av02:Front Door] netcam_hwdecoders: Norm: HW Devices: 
[INF][NET][00:av02:Front Door] netcam_hwdecoders: Norm: vdpau (not implemented)
[INF][NET][00:av02:Front Door] netcam_hwdecoders: Norm: vaapi (available)
[INF][NET][00:av02:Front Door] netcam_hwdecoders: Norm: drm (not implemented)
[INF][NET][00:av02:Front Door] netcam_hwdecoders: Norm: vulkan (not implemented)
[INF][NET][00:av02:Front Door] netcam_init_swdecoder: Norm: Initializing decoder
[INF][NET][00:av02:Front Door] netcam_open_codec: Norm: Decoder opened
[INF][ALL][00:ml00:Front Door] util_parms_parse: Starting parsing parameters
[NTC][NET][02:nc02:Front Door] netcam_handler: Norm: Camera handler thread [2] started
[DBG][ALL][00:ml00:Front Door] util_parms_parse_comma: Parsing: >framerate=15,capture_rate=15< >0 8 10 11<
[INF][NET][02:nc02:Front Door] netcam_set_options: Norm: Setting rtsp/rtmp
[INF][ALL][00:ml00:Front Door] util_parms_add: Parsed: >framerate< >15<
[DBG][ALL][00:ml00:Front Door] util_parms_parse_comma: Parsing: >capture_rate=15< >0 11 13 14<
[INF][ALL][00:ml00:Front Door] util_parms_add: Parsed: >capture_rate< >15<
[INF][NET][00:ml00:Front Door] netcam_set_parms: High: Setting up camera.
[INF][ALL][00:ml00:Front Door] util_parms_add: Parsed: >decoder< >NULL<
[INF][NET][00:ml00:Front Door] netcam_url_parse: Using port number 1935
[INF][NET][00:ml00:Front Door] netcam_set_path: Setting up rtmp 
[INF][NET][00:ml00:Front Door] netcam_set_options: High: Setting rtsp/rtmp
[INF][ALL][00:ml00:Front Door] util_parms_add: Parsed: >rtsp_transport< >tcp<
[INF][NET][00:ml00:Front Door] netcam_set_options: High: option: framerate = 15
[INF][NET][00:ml00:Front Door] netcam_set_options: High: option: rtsp_transport = tcp
[INF][NET][02:nc02:Front Door] netcam_open_context: Norm: Opened camera(Front Door)
[INF][NET][00:ml00:Front Door] netcam_open_context: High: Opened camera(Front Door)
[INF][NET][02:av02:Front Door] netcam_init_swdecoder: Norm: Initializing decoder
[INF][NET][02:av02:Front Door] netcam_open_codec: Norm: Decoder opened
[NTC][NET][02:nc02:Front Door] netcam_connect: Norm: Camera (Front Door) connected
[NTC][NET][02:nc02:Front Door] netcam_connect: Norm: Netcam capture FPS is 30.
[NTC][NET][02:nc02:Front Door] netcam_connect: Norm: Camera source is 25 FPS
[INF][NET][02:nc02:Front Door] netcam_connect: Norm: An audio stream was detected.  Capture_rate increased to compensate.
[INF][NET][00:av03:Front Door] netcam_hwdecoders: High: HW Devices: 
[INF][NET][00:av03:Front Door] netcam_hwdecoders: High: vdpau (not implemented)
[INF][NET][00:av03:Front Door] netcam_hwdecoders: High: vaapi (available)
[INF][NET][00:av03:Front Door] netcam_hwdecoders: High: drm (not implemented)
[INF][NET][00:av03:Front Door] netcam_hwdecoders: High: vulkan (not implemented)
[INF][NET][00:av03:Front Door] netcam_init_swdecoder: High: Initializing decoder
[INF][NET][00:av03:Front Door] netcam_open_codec: High: Decoder opened
[NTC][ALL][00:ml00:Front Door] mlp_ring_resize: Resizing buffer to 1 items
[NTC][NET][03:nc03:Front Door] netcam_handler: High: Camera handler thread [3] started
[INF][NET][03:nc03:Front Door] netcam_set_options: High: Setting rtsp/rtmp
[INF][NET][03:nc03:Front Door] netcam_open_context: High: Opened camera(Front Door)
[INF][NET][03:av03:Front Door] netcam_init_swdecoder: High: Initializing decoder
[INF][NET][03:av03:Front Door] netcam_open_codec: High: Decoder opened
[NTC][ALL][00:ml00:Front Door] mlp_init: Camera 1 started: motion detection Enabled
Mr-Dave commented 1 year ago

I'm not able to reproduce this one. Turning off the movie and picture output and only leaving the snapshot on for every second seems to work OK on my test computer.

Can you check the live stream to validate the camera is working? This issue indicates Motionplus exits and writes 0 bytes, can you post that section of the log?

CRCinAU commented 1 year ago

Interesting. The above log is all I get before motionplus exits - that's from program launch to program exit.

If you use Docker at all, can you test this package? https://hub.docker.com/r/crcinau/motionplus

I wonder if I'm somehow missing a library or if I need to add something else?

Mr-Dave commented 1 year ago

I don't really do docker anymore after their change of terms.

If that is the extent of the log, how are you validating that it shut down? When you run it in a docker terminal, is it terminating there?

CRCinAU commented 1 year ago

Yeah - if I run it interactively, it just exits... I'm just about to rebuild the containers with the new commits over the last 24 hours or so and will test again.

Mr-Dave commented 1 year ago

There will be more commits soon. None are going to have anything to do with this issue (which to me seems like something associated with docker).

CRCinAU commented 1 year ago

I updated the containers based on code in master as of now - and this doesn't seem to happen anymore....

I wonder if it was fixed by this commit: https://github.com/Motion-Project/motionplus/commit/5801d52dda3cbd08037a43bde2b79aa9e3b4708c

I'll keep testing and close this if I don't see this issue anymore.

CRCinAU commented 1 year ago

This seems to be resolved with the above mentioned commit. Closing.