Motion-Project / motion

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

Motion dies immediately after start the daemon #1739

Closed llopez closed 10 months ago

llopez commented 10 months ago

Did you read the guide?

Yes

What is the base version number of Motion being used?

4.6.x

What was the install method?

Installed via package tool

What is base architecture?

ARM-64bit

What is the distro being used?

Raspbian

Disto version number

Debian GNU/Linux 12 (bookworm)

Camera type(s) being used?

Network camera with HTTP

Describe the issue/problem and steps to reproduce

Starting the daemon with the bellow command crashes immediately sudo service motion start Starting the daemon without service last a little more but after some time it crashes again sudo motion

I guess the cause of the problem is Unable to determine the camera source FPS. but I am not sure.

I am using a IP camera: tp-link nc200

is there any workaround?

thanks

Motion log output at log_level 8

[0:motion] [NTC] [ALL] [Jan 06 11:59:26] motion_startup: Motion 4.6.0 Started
[0:motion] [NTC] [ALL] [Jan 06 11:59:26] motion_startup: Using default log type (ALL)
[0:motion] [NTC] [ALL] [Jan 06 11:59:26] motion_startup: Using log type (ALL) log level (DBG)
[0:motion] [NTC] [ALL] [Jan 06 11:59:26] become_daemon: Motion going to daemon mode
[0:motion] [NTC] [ALL] [Jan 06 11:59:26] motion_startup: Motion running as daemon process
[0:motion] [INF] [ALL] [Jan 06 11:59:26] conf_output_parms: Writing configuration parameters from all files (1):
[0:motion] [INF] [ALL] [Jan 06 11:59:26] Thread 0 - Config file: /etc/motion/motion.conf
[0:motion] [INF] [ALL] [Jan 06 11:59:26] daemon                    on
[0:motion] [INF] [ALL] [Jan 06 11:59:26] setup_mode                off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] pid_file                  
[0:motion] [INF] [ALL] [Jan 06 11:59:26] log_file                  /var/log/motion/motion.log
[0:motion] [INF] [ALL] [Jan 06 11:59:26] log_level                 8
[0:motion] [INF] [ALL] [Jan 06 11:59:26] log_type                  ALL
[0:motion] [INF] [ALL] [Jan 06 11:59:26] quiet                     on
[0:motion] [INF] [ALL] [Jan 06 11:59:26] native_language           on
[0:motion] [INF] [ALL] [Jan 06 11:59:26] watchdog_tmo              30
[0:motion] [INF] [ALL] [Jan 06 11:59:26] watchdog_kill             10
[0:motion] [INF] [ALL] [Jan 06 11:59:26] camera_name               
[0:motion] [INF] [ALL] [Jan 06 11:59:26] camera_id                 0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] target_dir                
[0:motion] [INF] [ALL] [Jan 06 11:59:26] video_device              /dev/video0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] video_params              
[0:motion] [INF] [ALL] [Jan 06 11:59:26] auto_brightness           0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] tuner_device              
[0:motion] [INF] [ALL] [Jan 06 11:59:26] roundrobin_frames         1
[0:motion] [INF] [ALL] [Jan 06 11:59:26] roundrobin_skip           1
[0:motion] [INF] [ALL] [Jan 06 11:59:26] roundrobin_switchfilter   off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] netcam_url                <redacted>
[0:motion] [INF] [ALL] [Jan 06 11:59:26] netcam_params             
[0:motion] [INF] [ALL] [Jan 06 11:59:26] netcam_high_url           
[0:motion] [INF] [ALL] [Jan 06 11:59:26] netcam_high_params        
[0:motion] [INF] [ALL] [Jan 06 11:59:26] netcam_userpass           
[0:motion] [INF] [ALL] [Jan 06 11:59:26] mmalcam_name              
[0:motion] [INF] [ALL] [Jan 06 11:59:26] mmalcam_params            
[0:motion] [INF] [ALL] [Jan 06 11:59:26] width                     640
[0:motion] [INF] [ALL] [Jan 06 11:59:26] height                    480
[0:motion] [INF] [ALL] [Jan 06 11:59:26] framerate                 15
[0:motion] [INF] [ALL] [Jan 06 11:59:26] minimum_frame_time        0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] rotate                    0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] flip_axis                 none
[0:motion] [INF] [ALL] [Jan 06 11:59:26] locate_motion_mode        off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] locate_motion_style       box
[0:motion] [INF] [ALL] [Jan 06 11:59:26] text_left                 CAMERA1
[0:motion] [INF] [ALL] [Jan 06 11:59:26] text_right                %Y-%m-%d\n%T-%q
[0:motion] [INF] [ALL] [Jan 06 11:59:26] text_changes              off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] text_scale                1
[0:motion] [INF] [ALL] [Jan 06 11:59:26] text_event                %Y%m%d%H%M%S
[0:motion] [INF] [ALL] [Jan 06 11:59:26] emulate_motion            off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] pause                     off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] threshold                 1500
[0:motion] [INF] [ALL] [Jan 06 11:59:26] threshold_maximum         0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] threshold_tune            off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] noise_level               32
[0:motion] [INF] [ALL] [Jan 06 11:59:26] noise_tune                on
[0:motion] [INF] [ALL] [Jan 06 11:59:26] despeckle_filter          EedDl
[0:motion] [INF] [ALL] [Jan 06 11:59:26] area_detect               
[0:motion] [INF] [ALL] [Jan 06 11:59:26] mask_file                 
[0:motion] [INF] [ALL] [Jan 06 11:59:26] mask_privacy              
[0:motion] [INF] [ALL] [Jan 06 11:59:26] smart_mask_speed          0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] lightswitch_percent       0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] lightswitch_frames        5
[0:motion] [INF] [ALL] [Jan 06 11:59:26] minimum_motion_frames     1
[0:motion] [INF] [ALL] [Jan 06 11:59:26] event_gap                 60
[0:motion] [INF] [ALL] [Jan 06 11:59:26] pre_capture               3
[0:motion] [INF] [ALL] [Jan 06 11:59:26] post_capture              0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] on_event_start            
[0:motion] [INF] [ALL] [Jan 06 11:59:26] on_event_end              
[0:motion] [INF] [ALL] [Jan 06 11:59:26] on_picture_save           
[0:motion] [INF] [ALL] [Jan 06 11:59:26] on_area_detected          
[0:motion] [INF] [ALL] [Jan 06 11:59:26] on_motion_detected        
[0:motion] [INF] [ALL] [Jan 06 11:59:26] on_movie_start            
[0:motion] [INF] [ALL] [Jan 06 11:59:26] on_movie_end              
[0:motion] [INF] [ALL] [Jan 06 11:59:26] on_camera_lost            
[0:motion] [INF] [ALL] [Jan 06 11:59:26] on_camera_found           
[0:motion] [INF] [ALL] [Jan 06 11:59:26] picture_output            off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] picture_output_motion     off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] picture_type              jpeg
[0:motion] [INF] [ALL] [Jan 06 11:59:26] picture_quality           75
[0:motion] [INF] [ALL] [Jan 06 11:59:26] picture_exif              
[0:motion] [INF] [ALL] [Jan 06 11:59:26] picture_filename          %Y%m%d%H%M%S-%q
[0:motion] [INF] [ALL] [Jan 06 11:59:26] snapshot_interval         0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] snapshot_filename         %v-%Y%m%d%H%M%S-snapshot
[0:motion] [INF] [ALL] [Jan 06 11:59:26] movie_output              on
[0:motion] [INF] [ALL] [Jan 06 11:59:26] movie_output_motion       off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] movie_max_time            60
[0:motion] [INF] [ALL] [Jan 06 11:59:26] movie_bps                 400000
[0:motion] [INF] [ALL] [Jan 06 11:59:26] movie_quality             45
[0:motion] [INF] [ALL] [Jan 06 11:59:26] movie_codec               mkv
[0:motion] [INF] [ALL] [Jan 06 11:59:26] movie_duplicate_frames    off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] movie_passthrough         off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] movie_filename            %t-%v-%Y%m%d%H%M%S
[0:motion] [INF] [ALL] [Jan 06 11:59:26] movie_extpipe_use         off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] movie_extpipe             
[0:motion] [INF] [ALL] [Jan 06 11:59:26] timelapse_interval        0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] timelapse_mode            daily
[0:motion] [INF] [ALL] [Jan 06 11:59:26] timelapse_fps             30
[0:motion] [INF] [ALL] [Jan 06 11:59:26] timelapse_codec           mpg
[0:motion] [INF] [ALL] [Jan 06 11:59:26] timelapse_filename        %Y%m%d-timelapse
[0:motion] [INF] [ALL] [Jan 06 11:59:26] video_pipe                
[0:motion] [INF] [ALL] [Jan 06 11:59:26] video_pipe_motion         
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_port           8080
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_ipv6           off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_localhost      off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_parms          0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_interface      0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_auth_method    0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_authentication 
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_tls            off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_cert           
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_key            
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_header_params  
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_lock_minutes   5
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_lock_attempts  5
[0:motion] [INF] [ALL] [Jan 06 11:59:26] webcontrol_lock_max_ips   25
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_port               8081
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_localhost          off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_auth_method        0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_authentication     
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_tls                off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_header_params      
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_preview_scale      25
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_preview_newline    off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_preview_method     0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_quality            50
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_grey               off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_motion             off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_maxrate            1
[0:motion] [INF] [ALL] [Jan 06 11:59:26] stream_limit              0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] database_type             
[0:motion] [INF] [ALL] [Jan 06 11:59:26] database_dbname           
[0:motion] [INF] [ALL] [Jan 06 11:59:26] database_host             localhost
[0:motion] [INF] [ALL] [Jan 06 11:59:26] database_port             0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] database_user             
[0:motion] [INF] [ALL] [Jan 06 11:59:26] database_password         
[0:motion] [INF] [ALL] [Jan 06 11:59:26] database_busy_timeout     0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] sql_log_picture           off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] sql_log_snapshot          off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] sql_log_movie             off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] sql_log_timelapse         off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] sql_query_start           
[0:motion] [INF] [ALL] [Jan 06 11:59:26] sql_query_stop            
[0:motion] [INF] [ALL] [Jan 06 11:59:26] sql_query                 
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_type                0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_auto                off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_port                
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_motorx              0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_motorx_reverse      off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_motory              0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_motory_reverse      off
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_maxx                0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_minx                0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_maxy                0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_miny                0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_homex               128
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_homey               128
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_iomojo_id           0
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_step_angle_x        10
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_step_angle_y        10
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_move_wait           10
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_speed               255
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_stepsize            40
[0:motion] [INF] [ALL] [Jan 06 11:59:26] track_generic_move        
[0:motion] [INF] [ALL] [Jan 06 11:59:26] camera                    
[0:motion] [INF] [ALL] [Jan 06 11:59:26] camera_dir                
[0:motion] [DBG] [ALL] [Jan 06 11:59:26] motion_ntc: v4l2   : available
[0:motion] [DBG] [ALL] [Jan 06 11:59:26] motion_ntc: bktr   : not available
[0:motion] [DBG] [ALL] [Jan 06 11:59:26] motion_ntc: webp   : available
[0:motion] [DBG] [ALL] [Jan 06 11:59:26] motion_ntc: mmal   : not available
[0:motion] [DBG] [ALL] [Jan 06 11:59:26] motion_ntc: ffmpeg : available
[0:motion] [DBG] [DBL] [Jan 06 11:59:26] motion_ntc: mysql  : not available
[0:motion] [DBG] [DBL] [Jan 06 11:59:26] motion_ntc: MariaDB: available
[0:motion] [DBG] [DBL] [Jan 06 11:59:26] motion_ntc: sqlite3: available
[0:motion] [DBG] [DBL] [Jan 06 11:59:26] motion_ntc: pgsql  : available
[0:motion] [DBG] [DBL] [Jan 06 11:59:26] motion_ntc: nls    : available
[0:motion] [NTC] [STR] [Jan 06 11:59:26] webu_start_strm: Starting all camera streams on port 8081
[0:motion] [DBG] [STR] [Jan 06 11:59:26] webu_mhd_features_basic: Basic authentication: available
[0:motion] [DBG] [STR] [Jan 06 11:59:26] webu_mhd_features_digest: Digest authentication: available
[0:motion] [DBG] [STR] [Jan 06 11:59:26] webu_mhd_features_ipv6: IPV6: available
[0:motion] [DBG] [STR] [Jan 06 11:59:26] webu_mhd_features_tls: SSL/TLS: available
[0:motion] [NTC] [STR] [Jan 06 11:59:26] webu_strm_ntc: Started camera 0 stream on port 8081
[0:motion] [NTC] [STR] [Jan 06 11:59:26] webu_start_ctrl: Starting webcontrol on port 8080
[0:motion] [DBG] [STR] [Jan 06 11:59:26] webu_mhd_features_basic: Basic authentication: available
[0:motion] [DBG] [STR] [Jan 06 11:59:26] webu_mhd_features_digest: Digest authentication: available
[0:motion] [DBG] [STR] [Jan 06 11:59:26] webu_mhd_features_ipv6: IPV6: available
[0:motion] [DBG] [STR] [Jan 06 11:59:26] webu_mhd_features_tls: SSL/TLS: available
[0:motion] [NTC] [STR] [Jan 06 11:59:26] webu_start_ctrl: Started webcontrol on port 8080
[0:motion] [NTC] [ENC] [Jan 06 11:59:26] ffmpeg_global_init: ffmpeg libavcodec version 59.37.100 libavformat version 59.27.100
[0:motion] [DBG] [DBL] [Jan 06 11:59:26] dbse_global_init: Initializing database
[0:motion] [NTC] [ALL] [Jan 06 11:59:26] translate_init: Language: English
[0:motion] [NTC] [ALL] [Jan 06 11:59:26] motion_start_thread: Camera ID: 0 is from /etc/motion/motion.conf
[0:motion] [NTC] [ALL] [Jan 06 11:59:26] motion_start_thread: Camera ID: 0 Camera Name: (null) Service: http:
[0:motion] [NTC] [ALL] [Jan 06 11:59:26] main: Waiting for threads to finish, pid: 1182
[1:ml1] [NTC] [ALL] [Jan 06 11:59:26] motion_init: Camera 0 started: motion detection Enabled
[1:ml1] [NTC] [VID] [Jan 06 11:59:26] vid_start: Opening Netcam RTSP
[1:ml1] [INF] [NET] [Jan 06 11:59:26] netcam_rtsp_set_parms: Setting up norm stream.
[1:ml1] [DBG] [ALL] [Jan 06 11:59:26] util_parms_add: Parsed: >decoder< >NULL<
[1:ml1] [INF] [NET] [Jan 06 11:59:26] netcam_rtsp_set_path: Setting up http via netcam
[1:ml1] [INF] [NET] [Jan 06 11:59:26] netcam_rtsp_set_options: norm: Setting input_format mjpeg
[1:ml1] [DBG] [ALL] [Jan 06 11:59:26] util_parms_add: Parsed: >reconnect_on_network_error< >1<
[1:ml1] [DBG] [ALL] [Jan 06 11:59:26] util_parms_add: Parsed: >reconnect_at_eof< >1<
[1:ml1] [DBG] [ALL] [Jan 06 11:59:26] util_parms_add: Parsed: >reconnect< >1<
[1:ml1] [DBG] [ALL] [Jan 06 11:59:26] util_parms_add: Parsed: >multiple_requests< >1<
[1:ml1] [DBG] [ALL] [Jan 06 11:59:26] util_parms_add: Parsed: >reconnect_streamed< >1<
[1:ml1] [INF] [NET] [Jan 06 11:59:26] netcam_rtsp_set_options: norm: option: reconnect_on_network_error = 1
[1:ml1] [INF] [NET] [Jan 06 11:59:26] netcam_rtsp_set_options: norm: option: reconnect_at_eof = 1
[1:ml1] [INF] [NET] [Jan 06 11:59:26] netcam_rtsp_set_options: norm: option: reconnect = 1
[1:ml1] [INF] [NET] [Jan 06 11:59:26] netcam_rtsp_set_options: norm: option: multiple_requests = 1
[1:ml1] [INF] [NET] [Jan 06 11:59:26] netcam_rtsp_set_options: norm: option: reconnect_streamed = 1
[0:motion] [NTC] [ALL] [Jan 06 11:59:26] sig_handler: Received signal 15.
[1:ml1] [INF] [NET] [Jan 06 11:59:26] netcam_rtsp_open_context: norm: Opened camera((null))
[1:av0] [INF] [NET] [Jan 06 11:59:27] netcam_hwdecoders: norm: HW Devices: 
[1:av0] [INF] [NET] [Jan 06 11:59:27] netcam_hwdecoders: norm: vdpau (not implemented)
[1:av0] [INF] [NET] [Jan 06 11:59:27] netcam_hwdecoders: norm: cuda (available)
[1:av0] [INF] [NET] [Jan 06 11:59:27] netcam_hwdecoders: norm: vaapi (available)
[1:av0] [INF] [NET] [Jan 06 11:59:27] netcam_hwdecoders: norm: drm (available)
[1:av0] [INF] [NET] [Jan 06 11:59:27] netcam_hwdecoders: norm: opencl (not implemented)
[1:av0] [INF] [NET] [Jan 06 11:59:27] netcam_hwdecoders: norm: vulkan (not implemented)
[1:av0] [INF] [NET] [Jan 06 11:59:27] netcam_init_swdecoder: norm: Initializing decoder
[1:av0] [INF] [NET] [Jan 06 11:59:27] netcam_rtsp_open_codec: norm: Decoder opened
[1:ml1] [DBG] [NET] [Jan 06 11:59:27] netcam_check_buffsize: expanding buffer from [0/0] to [0/614400] bytes.
[1:ml1] [INF] [ENC] Above message repeats 1 times
[1:ml1] [INF] [ENC] [Jan 06 11:59:27] ffmpeg_avcodec_log: deprecated pixel format used, make sure you did set range correctly
[1:ml1] [DBG] [NET] [Jan 06 11:59:27] netcam_check_buffsize: expanding buffer from [614400/614400] to [614400/1077248] bytes.
[1:ml1] [INF] [NET] [Jan 06 11:59:27] netcam_rtsp_read_image: norm: capture_rate not specified in netcam_params. Using framerate 15
[1:ml1] [NTC] [NET] [Jan 06 11:59:27] netcam_rtsp_ntc: 
[1:ml1] [NTC] [NET] [Jan 06 11:59:27] netcam_rtsp_ntc: ******************************************************
[1:ml1] [NTC] [NET] [Jan 06 11:59:27] netcam_rtsp_ntc: The image sent is being 
[1:ml1] [NTC] [NET] [Jan 06 11:59:27] netcam_rtsp_ntc: trancoded to YUV420P.  If possible change netcam 
[1:ml1] [NTC] [NET] [Jan 06 11:59:27] netcam_rtsp_ntc: picture format to YUV420P to possibly lower CPU usage.
[1:ml1] [NTC] [NET] [Jan 06 11:59:27] netcam_rtsp_ntc: ******************************************************
[1:ml1] [NTC] [NET] [Jan 06 11:59:27] netcam_rtsp_ntc: 
[1:ml1] [DBG] [NET] [Jan 06 11:59:27] netcam_check_buffsize: expanding buffer from [460800/614400] to [460800/1077248] bytes.
[1:ml1] [NTC] [ALL] [Jan 06 11:59:27] image_ring_resize: Resizing pre_capture buffer to 1 items
[2:nc2] [NTC] [NET] [Jan 06 11:59:27] netcam_rtsp_handler: norm: Camera handler thread [2] started
[2:nc2] [INF] [NET] [Jan 06 11:59:27] netcam_rtsp_set_options: norm: Setting input_format mjpeg
[2:nc2] [INF] [NET] [Jan 06 11:59:27] netcam_rtsp_open_context: norm: Opened camera((null))
[2:av2] [INF] [NET] [Jan 06 11:59:27] netcam_init_swdecoder: norm: Initializing decoder
[2:av2] [INF] [NET] [Jan 06 11:59:27] netcam_rtsp_open_codec: norm: Decoder opened
[2:nc2] [INF] [ENC] [Jan 06 11:59:27] ffmpeg_avcodec_log: deprecated pixel format used, make sure you did set range correctly
[2:nc2] [NTC] [NET] [Jan 06 11:59:27] netcam_rtsp_connect: norm: Camera ((null)) connected
[2:nc2] [INF] [NET] [Jan 06 11:59:27] netcam_rtsp_connect: norm: Netcam capture_rate is 15.
[2:nc2] [NTC] [NET] [Jan 06 11:59:27] netcam_rtsp_connect: norm: Unable to determine the camera source FPS.
[1:ml1] [NTC] [ALL] [Jan 06 11:59:29] image_ring_resize: Resizing pre_capture buffer to 4 items
[1:ml1] [NTC] [ALL] [Jan 06 11:59:29] motion_loop: Thread exiting
[1:ml1] [INF] [VID] [Jan 06 11:59:29] vid_close: calling netcam_rtsp_cleanup
[1:ml1] [INF] [NET] [Jan 06 11:59:29] netcam_rtsp_cleanup: norm: Shutting down network camera.
[2:nc2] [INF] [NET] [Jan 06 11:59:29] netcam_rtsp_handler: norm: Handler loop finished.
[2:nc2] [INF] [NET] [Jan 06 11:59:30] netcam_rtsp_handler: netcam camera handler: finish set, exiting
[1:ml1] [NTC] [NET] [Jan 06 11:59:31] netcam_rtsp_cleanup: Normal resolution: Shut down complete.
[0:motion] [NTC] [ALL] [Jan 06 11:59:31] main: Threads finished
[0:motion] [NTC] [ALL] [Jan 06 11:59:31] main: Motion terminating
[0:motion] [NTC] [ALL] [Jan 06 11:59:31] motion_remove_pid: Closing logfile (/var/log/motion/motion.log).
tosiara commented 10 months ago

can you share the exact config you used?

llopez commented 10 months ago

I guess the config is shown on the logs because I have generated it with log level 8

llopez commented 10 months ago
# Rename this distribution example file to motion.conf
#
# This config file was generated by motion 4.6.0
# 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 on

# 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 /var/log/motion/motion.log

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

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

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

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

# The full URL of the network camera stream.
netcam_url http://admin:YWRtaW4=@192.168.0.68:8080/stream/getvideo

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

# Camera control parameters (see raspivid/raspistill tool documentation)
; mmalcam_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 CAMERA1

# 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 off

# 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 off

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

##############################################################
# Directory to read '.conf' files for cameras.
##############################################################
; camera_dir /usr/etc/motion/conf.d
llopez commented 10 months ago

I guess the error is because motion cannot detect the framerate from the Ip camera.

tosiara commented 10 months ago

Even in case of no stream available, motion would loop forever waiting for picture to be available. But in your case the process exits because of:

[0:motion] [NTC] [ALL] [Jan 06 11:59:26] sig_handler: Received signal 15.

The OS sends SIGTERM to motion.

Please check syslog in order to see who and why kills motion. maybe it's OOM?

Mr-Dave commented 10 months ago

I'd guess it is because systemctl requires daemon to be off. Documentation reference

llopez commented 10 months ago

@Mr-Dave you are right. that was the issue. thanks a lot man

llopez commented 10 months ago

closing the issue because it is solved :)