Motion-Project / motion

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

Unable to stream video on MacBook Pro 2012 #1783

Closed lodenrogue closed 4 months ago

lodenrogue commented 4 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?

x86

What is the distro being used?

Ubuntu

Disto version number

24.04

Camera type(s) being used?

Other

Describe the issue/problem and steps to reproduce

I am using the built in camera of a Macbook Pro 2012 running Ubuntu 24.04. I am able to take pictures and video with streamer and fswebcam successfully. I installed motion via apt install and set my ~/.motion/motion.conf as:

stream_port 8080
stream_localhost off

Then I start motion by running in the terminal:

motion

When I visit hostname:8080 I see a gray screen that shows the text "Unable to open video device".

I see some potential errors in the logs. I will place those in the next section.

lshw camera information:

description: Video
                      product: FaceTime HD Camera (Built-in)
                      vendor: Apple Inc.
                      physical id: 1
                      bus info: usb@1:1.1
                      version: 5.16
                      serial: CC2D5B0CSDDG6LL0
                      capabilities: usb-2.00
                      configuration: driver=uvcvideo maxpower=500mA speed=480Mbit/s

Motion log output at log_level 8

[0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /home/mb12/.motion/motion.conf
[0:motion] [NTC] [ALL] motion_startup: Logging to syslog
[0:motion] [NTC] [ALL] motion_startup: Motion 4.6.0 Started
[0:motion] [NTC] [ALL] motion_startup: Using default log type (ALL)
[0:motion] [NTC] [ALL] motion_startup: Using log type (ALL) log level (DBG)
[0:motion] [INF] [ALL] conf_output_parms: Writing configuration parameters from all files (1):
[0:motion] [INF] [ALL] Thread 0 - Config file: /home/mb12/.motion/motion.conf
[0:motion] [INF] [ALL] daemon                    off
[0:motion] [INF] [ALL] setup_mode                off
[0:motion] [INF] [ALL] pid_file                  
[0:motion] [INF] [ALL] log_file                  
[0:motion] [INF] [ALL] log_level                 8
[0:motion] [INF] [ALL] log_type                  ALL
[0:motion] [INF] [ALL] quiet                     on
[0:motion] [INF] [ALL] native_language           on
[0:motion] [INF] [ALL] watchdog_tmo              30
[0:motion] [INF] [ALL] watchdog_kill             10
[0:motion] [INF] [ALL] camera_name               
[0:motion] [INF] [ALL] camera_id                 0
[0:motion] [INF] [ALL] target_dir                
[0:motion] [INF] [ALL] video_device              /dev/video0
[0:motion] [INF] [ALL] video_params              
[0:motion] [INF] [ALL] auto_brightness           0
[0:motion] [INF] [ALL] tuner_device              
[0:motion] [INF] [ALL] roundrobin_frames         1
[0:motion] [INF] [ALL] roundrobin_skip           1
[0:motion] [INF] [ALL] roundrobin_switchfilter   off
[0:motion] [INF] [ALL] netcam_url                
[0:motion] [INF] [ALL] netcam_params             
[0:motion] [INF] [ALL] netcam_high_url           
[0:motion] [INF] [ALL] netcam_high_params        
[0:motion] [INF] [ALL] netcam_userpass           
[0:motion] [INF] [ALL] mmalcam_name              
[0:motion] [INF] [ALL] mmalcam_params            
[0:motion] [INF] [ALL] width                     640
[0:motion] [INF] [ALL] height                    480
[0:motion] [INF] [ALL] framerate                 15
[0:motion] [INF] [ALL] minimum_frame_time        0
[0:motion] [INF] [ALL] rotate                    0
[0:motion] [INF] [ALL] flip_axis                 none
[0:motion] [INF] [ALL] locate_motion_mode        off
[0:motion] [INF] [ALL] locate_motion_style       box
[0:motion] [INF] [ALL] text_left                 
[0:motion] [INF] [ALL] text_right                %Y-%m-%d\n%T
[0:motion] [INF] [ALL] text_changes              off
[0:motion] [INF] [ALL] text_scale                1
[0:motion] [INF] [ALL] text_event                %Y%m%d%H%M%S
[0:motion] [INF] [ALL] emulate_motion            off
[0:motion] [INF] [ALL] pause                     off
[0:motion] [INF] [ALL] threshold                 1500
[0:motion] [INF] [ALL] threshold_maximum         0
[0:motion] [INF] [ALL] threshold_tune            off
[0:motion] [INF] [ALL] noise_level               32
[0:motion] [INF] [ALL] noise_tune                on
[0:motion] [INF] [ALL] despeckle_filter          
[0:motion] [INF] [ALL] area_detect               
[0:motion] [INF] [ALL] mask_file                 
[0:motion] [INF] [ALL] mask_privacy              
[0:motion] [INF] [ALL] smart_mask_speed          0
[0:motion] [INF] [ALL] lightswitch_percent       0
[0:motion] [INF] [ALL] lightswitch_frames        5
[0:motion] [INF] [ALL] minimum_motion_frames     1
[0:motion] [INF] [ALL] event_gap                 60
[0:motion] [INF] [ALL] pre_capture               0
[0:motion] [INF] [ALL] post_capture              0
[0:motion] [INF] [ALL] on_event_start            
[0:motion] [INF] [ALL] on_event_end              
[0:motion] [INF] [ALL] on_picture_save           
[0:motion] [INF] [ALL] on_area_detected          
[0:motion] [INF] [ALL] on_motion_detected        
[0:motion] [INF] [ALL] on_movie_start            
[0:motion] [INF] [ALL] on_movie_end              
[0:motion] [INF] [ALL] on_camera_lost            
[0:motion] [INF] [ALL] on_camera_found           
[0:motion] [INF] [ALL] picture_output            off
[0:motion] [INF] [ALL] picture_output_motion     off
[0:motion] [INF] [ALL] picture_type              jpeg
[0:motion] [INF] [ALL] picture_quality           75
[0:motion] [INF] [ALL] picture_exif              
[0:motion] [INF] [ALL] picture_filename          %v-%Y%m%d%H%M%S-%q
[0:motion] [INF] [ALL] snapshot_interval         0
[0:motion] [INF] [ALL] snapshot_filename         %v-%Y%m%d%H%M%S-snapshot
[0:motion] [INF] [ALL] movie_output              on
[0:motion] [INF] [ALL] movie_output_motion       off
[0:motion] [INF] [ALL] movie_max_time            120
[0:motion] [INF] [ALL] movie_bps                 400000
[0:motion] [INF] [ALL] movie_quality             60
[0:motion] [INF] [ALL] movie_codec               mkv
[0:motion] [INF] [ALL] movie_duplicate_frames    off
[0:motion] [INF] [ALL] movie_passthrough         off
[0:motion] [INF] [ALL] movie_filename            %v-%Y%m%d%H%M%S
[0:motion] [INF] [ALL] movie_extpipe_use         off
[0:motion] [INF] [ALL] movie_extpipe             
[0:motion] [INF] [ALL] timelapse_interval        0
[0:motion] [INF] [ALL] timelapse_mode            daily
[0:motion] [INF] [ALL] timelapse_fps             30
[0:motion] [INF] [ALL] timelapse_codec           mpg
[0:motion] [INF] [ALL] timelapse_filename        %Y%m%d-timelapse
[0:motion] [INF] [ALL] video_pipe                
[0:motion] [INF] [ALL] video_pipe_motion         
[0:motion] [INF] [ALL] webcontrol_port           0
[0:motion] [INF] [ALL] webcontrol_ipv6           off
[0:motion] [INF] [ALL] webcontrol_localhost      on
[0:motion] [INF] [ALL] webcontrol_parms          0
[0:motion] [INF] [ALL] webcontrol_interface      0
[0:motion] [INF] [ALL] webcontrol_auth_method    0
[0:motion] [INF] [ALL] webcontrol_authentication 
[0:motion] [INF] [ALL] webcontrol_tls            off
[0:motion] [INF] [ALL] webcontrol_cert           
[0:motion] [INF] [ALL] webcontrol_key            
[0:motion] [INF] [ALL] webcontrol_header_params  
[0:motion] [INF] [ALL] webcontrol_lock_minutes   5
[0:motion] [INF] [ALL] webcontrol_lock_attempts  5
[0:motion] [INF] [ALL] webcontrol_lock_max_ips   25
[0:motion] [INF] [ALL] stream_port               8080
[0:motion] [INF] [ALL] stream_localhost          off
[0:motion] [INF] [ALL] stream_auth_method        0
[0:motion] [INF] [ALL] stream_authentication     
[0:motion] [INF] [ALL] stream_tls                off
[0:motion] [INF] [ALL] stream_header_params      
[0:motion] [INF] [ALL] stream_preview_scale      25
[0:motion] [INF] [ALL] stream_preview_newline    off
[0:motion] [INF] [ALL] stream_preview_method     0
[0:motion] [INF] [ALL] stream_quality            50
[0:motion] [INF] [ALL] stream_grey               off
[0:motion] [INF] [ALL] stream_motion             off
[0:motion] [INF] [ALL] stream_maxrate            1
[0:motion] [INF] [ALL] stream_limit              0
[0:motion] [INF] [ALL] database_type             
[0:motion] [INF] [ALL] database_dbname           
[0:motion] [INF] [ALL] database_host             localhost
[0:motion] [INF] [ALL] database_port             0
[0:motion] [INF] [ALL] database_user             
[0:motion] [INF] [ALL] database_password         
[0:motion] [INF] [ALL] database_busy_timeout     0
[0:motion] [INF] [ALL] sql_log_picture           off
[0:motion] [INF] [ALL] sql_log_snapshot          off
[0:motion] [INF] [ALL] sql_log_movie             off
[0:motion] [INF] [ALL] sql_log_timelapse         off
[0:motion] [INF] [ALL] sql_query_start           
[0:motion] [INF] [ALL] sql_query_stop            
[0:motion] [INF] [ALL] sql_query                 
[0:motion] [INF] [ALL] track_type                0
[0:motion] [INF] [ALL] track_auto                off
[0:motion] [INF] [ALL] track_port                
[0:motion] [INF] [ALL] track_motorx              0
[0:motion] [INF] [ALL] track_motorx_reverse      off
[0:motion] [INF] [ALL] track_motory              0
[0:motion] [INF] [ALL] track_motory_reverse      off
[0:motion] [INF] [ALL] track_maxx                0
[0:motion] [INF] [ALL] track_minx                0
[0:motion] [INF] [ALL] track_maxy                0
[0:motion] [INF] [ALL] track_miny                0
[0:motion] [INF] [ALL] track_homex               128
[0:motion] [INF] [ALL] track_homey               128
[0:motion] [INF] [ALL] track_iomojo_id           0
[0:motion] [INF] [ALL] track_step_angle_x        10
[0:motion] [INF] [ALL] track_step_angle_y        10
[0:motion] [INF] [ALL] track_move_wait           10
[0:motion] [INF] [ALL] track_speed               255
[0:motion] [INF] [ALL] track_stepsize            40
[0:motion] [INF] [ALL] track_generic_move        
[0:motion] [INF] [ALL] camera                    
[0:motion] [INF] [ALL] camera_dir                
[0:motion] [DBG] [ALL] motion_ntc: v4l2   : available
[0:motion] [DBG] [ALL] motion_ntc: bktr   : not available
[0:motion] [DBG] [ALL] motion_ntc: webp   : not available
[0:motion] [DBG] [ALL] motion_ntc: mmal   : not available
[0:motion] [DBG] [ALL] motion_ntc: ffmpeg : available
[0:motion] [DBG] [DBL] motion_ntc: mysql  : available
[0:motion] [DBG] [DBL] motion_ntc: MariaDB: not available
[0:motion] [DBG] [DBL] motion_ntc: sqlite3: available
[0:motion] [DBG] [DBL] motion_ntc: pgsql  : available
[0:motion] [DBG] [DBL] motion_ntc: nls    : available
[0:motion] [NTC] [STR] webu_start_strm: Starting all camera streams on port 8080
[0:motion] [DBG] [STR] webu_mhd_features_basic: Basic authentication: available
[0:motion] [DBG] [STR] webu_mhd_features_digest: Digest authentication: available
[0:motion] [DBG] [STR] webu_mhd_features_ipv6: IPV6: available
[0:motion] [DBG] [STR] webu_mhd_features_tls: SSL/TLS: available
[0:motion] [NTC] [STR] webu_strm_ntc: Started camera 0 stream on port 8080
[0:motion] [NTC] [ENC] ffmpeg_global_init: ffmpeg libavcodec version 60.31.102 libavformat version 60.16.100
[0:motion] [DBG] [DBL] dbse_global_init: Initializing database
[0:motion] [NTC] [ALL] translate_init: Language: English
[0:motion] [NTC] [ALL] motion_start_thread: Camera ID: 0 is from /home/mb12/.motion/motion.conf
[0:motion] [NTC] [ALL] motion_start_thread: Camera ID: 0 Camera Name: (null) Device: /dev/video0
[0:motion] [NTC] [ALL] main: Waiting for threads to finish, pid: 1805
[1:ml1] [NTC] [ALL] motion_init: Camera 0 started: motion detection Enabled
[1:ml1] [NTC] [VID] vid_start: Opening V4L2 device
[1:ml1] [DBG] [ALL] util_parms_add: Parsed: >palette< >17<
[1:ml1] [DBG] [ALL] util_parms_add: Parsed: >input< >-1<
[1:ml1] [DBG] [ALL] util_parms_add: Parsed: >norm< >0<
[1:ml1] [DBG] [ALL] util_parms_add: Parsed: >frequency< >0<
[1:ml1] [NTC] [VID] v4l2_device_open: Using videodevice /dev/video0 and input -1
[1:ml1] [DBG] [VID] v4l2_device_capability: ------------------------
[1:ml1] [DBG] [VID] v4l2_device_capability: cap.driver: "uvcvideo"
[1:ml1] [DBG] [VID] v4l2_device_capability: cap.card: "FaceTime HD Camera (Built-in): "
[1:ml1] [DBG] [VID] v4l2_device_capability: cap.bus_info: "usb-0000:00:1a.0-1.1"
[1:ml1] [DBG] [VID] v4l2_device_capability: cap.capabilities=0x84A00001
[1:ml1] [DBG] [VID] v4l2_device_capability: ------------------------
[1:ml1] [NTC] [VID] v4l2_device_capability: - VIDEO_CAPTURE
[1:ml1] [NTC] [VID] v4l2_device_capability: - STREAMING
[1:ml1] [DBG] [VID] v4l2_input_select: Name = "Camera 1", type 0x00000002, status 00000000
[1:ml1] [NTC] [VID] v4l2_input_select: Name = "Camera 1"- CAMERA
[1:ml1] [NTC] [VID] v4l2_norm_select: Device does not support specifying PAL/NTSC norm
[1:ml1] [NTC] [VID] v4l2_pixfmt_try: Unable to use YU12 (640x480)
[1:ml1] [NTC] [VID] v4l2_pixfmt_select: Configuration palette index 17 (YU12) for 640x480 doesn't work.
[1:ml1] [NTC] [VID] v4l2_pixfmt_select: Supported palettes:
[1:ml1] [NTC] [VID] v4l2_pixfmt_select: (0) YUYV (YUYV 4:2:2)
[1:ml1] [DBG] [VID] v4l2_pixfmt_select: 0 - YUYV 4:2:2 (compressed : 0) (0x56595559)
[1:ml1] [NTC] [VID] v4l2_pixfmt_select: (1) MJPG (Motion-JPEG)
[1:ml1] [DBG] [VID] v4l2_pixfmt_select: 1 - Motion-JPEG (compressed : 1) (0x47504a4d)
[1:ml1] [NTC] [VID] v4l2_pixfmt_try: Testing palette MJPG (640x480)
[1:ml1] [DBG] [VID] v4l2_pixfmt_stride: Checking image size 960x540 with stride 0
[1:ml1] [DBG] [VID] v4l2_pixfmt_stride: No stride value provided from device.
[1:ml1] [WRN] [VID] v4l2_pixfmt_adj: Adjusting resolution from 640x480 to 960x540.
[1:ml1] [ERR] [VID] v4l2_pixfmt_adj: Adjusted resolution not modulo 8.
[1:ml1] [ERR] [VID] v4l2_pixfmt_adj: Specify different palette or width/height in config file.
[1:ml1] [ERR] [VID] v4l2_pixfmt_select: Palette selection failed for format MJPG
[1:ml1] [ERR] [VID] v4l2_pixfmt_select: Unable to find a compatible palette format.
[1:ml1] [DBG] [VID] v4l2_device_close: close
[1:ml1] [DBG] [VID] v4l2_device_cleanup: vid_source
[1:ml1] [ERR] [VID] vid_start: V4L2 device failed to open
[1:ml1] [WRN] [ALL] motion_init: Could not fetch initial image from camera 
[1:ml1] [WRN] [ALL] motion_init: Motion continues using width and height from config file(s)
[1:ml1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items
[1:ml1] [WRN] [ALL] mlp_retry: Retrying until successful connection with camera
[1:ml1] [NTC] [VID] vid_start: Opening V4L2 device
[1:ml1] [DBG] [ALL] util_parms_add: Parsed: >palette< >17<
[1:ml1] [DBG] [ALL] util_parms_add: Parsed: >input< >-1<
[1:ml1] [DBG] [ALL] util_parms_add: Parsed: >norm< >0<
[1:ml1] [DBG] [ALL] util_parms_add: Parsed: >frequency< >0<
[1:ml1] [NTC] [VID] v4l2_device_open: Using videodevice /dev/video0 and input -1
[1:ml1] [DBG] [VID] v4l2_device_capability: ------------------------
[1:ml1] [DBG] [VID] v4l2_device_capability: cap.driver: "uvcvideo"
[1:ml1] [DBG] [VID] v4l2_device_capability: cap.card: "FaceTime HD Camera (Built-in): "
[1:ml1] [DBG] [VID] v4l2_device_capability: cap.bus_info: "usb-0000:00:1a.0-1.1"
[1:ml1] [DBG] [VID] v4l2_device_capability: cap.capabilities=0x84A00001
[1:ml1] [DBG] [VID] v4l2_device_capability: ------------------------
[1:ml1] [NTC] [VID] v4l2_device_capability: - VIDEO_CAPTURE
[1:ml1] [NTC] [VID] v4l2_device_capability: - STREAMING
[1:ml1] [DBG] [VID] v4l2_input_select: Name = "Camera 1", type 0x00000002, status 00000000
[1:ml1] [NTC] [VID] v4l2_input_select: Name = "Camera 1"- CAMERA
[1:ml1] [NTC] [VID] v4l2_norm_select: Device does not support specifying PAL/NTSC norm
[1:ml1] [NTC] [VID] v4l2_pixfmt_try: Unable to use YU12 (640x480)
[1:ml1] [NTC] [VID] v4l2_pixfmt_select: Configuration palette index 17 (YU12) for 640x480 doesn't work.
[1:ml1] [NTC] [VID] v4l2_pixfmt_select: Supported palettes:
[1:ml1] [NTC] [VID] v4l2_pixfmt_select: (0) YUYV (YUYV 4:2:2)
[1:ml1] [DBG] [VID] v4l2_pixfmt_select: 0 - YUYV 4:2:2 (compressed : 0) (0x56595559)
[1:ml1] [NTC] [VID] v4l2_pixfmt_select: (1) MJPG (Motion-JPEG)
[1:ml1] [DBG] [VID] v4l2_pixfmt_select: 1 - Motion-JPEG (compressed : 1) (0x47504a4d)
[1:ml1] [NTC] [VID] v4l2_pixfmt_try: Testing palette MJPG (640x480)
[1:ml1] [DBG] [VID] v4l2_pixfmt_stride: Checking image size 960x540 with stride 0
[1:ml1] [DBG] [VID] v4l2_pixfmt_stride: No stride value provided from device.
[1:ml1] [WRN] [VID] v4l2_pixfmt_adj: Adjusting resolution from 640x480 to 960x540.
[1:ml1] [ERR] [VID] v4l2_pixfmt_adj: Adjusted resolution not modulo 8.
[1:ml1] [ERR] [VID] v4l2_pixfmt_adj: Specify different palette or width/height in config file.
[1:ml1] [ERR] [VID] v4l2_pixfmt_select: Palette selection failed for format MJPG
[1:ml1] [ERR] [VID] v4l2_pixfmt_select: Unable to find a compatible palette format.
[1:ml1] [DBG] [VID] v4l2_device_close: close
[1:ml1] [DBG] [VID] v4l2_device_cleanup: vid_source
[1:ml1] [ERR] [VID] vid_start: V4L2 device failed to open