pikvm / ustreamer

µStreamer - Lightweight and fast MJPEG-HTTP streamer
https://pikvm.org
GNU General Public License v3.0
1.62k stars 216 forks source link

CAP: Device select() timeout #278

Open Foxius opened 2 weeks ago

Foxius commented 2 weeks ago
-- INFO  [4318.843          ] -- Using V4L2 device: /dev/v4l/by-id/usb-SHENZHEN_AONI_ELECTRONIC_CO._LTD_Full_HD_webcam_AN20200521001-video-index0
-- INFO  [4318.843          ] -- CAP: Using capture type: single-planar
-- INFO  [4318.843          ] -- CAP: Using input channel: 0
-- INFO  [4318.909          ] -- CAP: Using resolution: 1280x720
-- INFO  [4318.909          ] -- CAP: Using format: MJPEG
-- INFO  [4318.971          ] -- CAP: Using HW FPS: 30
-- ERROR [4318.971          ] -- CAP: Device doesn't support setting of HW encoding quality parameters
-- INFO  [4318.971          ] -- CAP: Using IO method: MMAP
-- INFO  [4318.973          ] -- CAP: Requested 3 device buffers, got 3
-- INFO  [4318.993          ] -- CAP: Capturing started
-- INFO  [4318.993          ] -- Switching to HW encoder: the input is (M)JPEG ...
-- INFO  [4318.993          ] -- Using JPEG quality: encoder default
-- INFO  [4318.993          ] -- Creating pool JPEG with 1 workers ...
-- INFO  [4318.993          ] -- Capturing ...
^C-- INFO  [4319.055          ] -- ===== Stopping by SIGINT =====
-- INFO  [4319.055          ] -- HTTP: Eventloop stopped
-- ERROR [4319.995          ] -- CAP: Device select() timeout
-- INFO  [4320.000          ] -- Destroying workers pool JPEG ...
-- INFO  [4320.064          ] -- CAP: Capturing stopped
-- INFO  [4320.065          ] -- Bye-bye
saikonohack@raspberry:~/ustreamer $ v4l2-ctl -d /dev/v4l/by-id/usb-SHENZHEN_AONI_ELECTRONIC_CO._LTD_Full_HD_webcam_AN20200521001-video-index0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'MJPG' (Motion-JPEG, compressed)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                Size: Discrete 320x240
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                Size: Discrete 800x600
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                Size: Discrete 1280x960
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
        [1]: 'YUYV' (YUYV 4:2:2)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                Size: Discrete 320x240
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.040s (25.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                Size: Discrete 800x600
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                        Interval: Discrete 0.333s (3.000 fps)
                Size: Discrete 1280x960
                        Interval: Discrete 0.200s (5.000 fps)
                        Interval: Discrete 0.333s (3.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.200s (5.000 fps)

./ustreamer --device=/dev/v4l/by-id/usb-SHENZHEN_AONI_ELECTRONIC_CO._LTD_Full_HD_webcam_AN20200521001-video-index0 --host=0.0.0.0 --port=8080 --resolution 1280x720 --desired-fps=30 --format=MJPEG --drop-same-frames=30

mdevaev commented 2 weeks ago

Is it working with other software like mjpg-streamer?

Foxius commented 2 weeks ago

I honestly don't know how to use mjpeg-streamer. But I for example wrote a script in python and translated it to browser. it works but not for klipper. (but for example in telegram addon the same link works)

mdevaev commented 2 weeks ago

Wait a moment. Before you're hitting Ctrl+C, do you have a video stream?

Foxius commented 2 weeks ago

no

mdevaev commented 2 weeks ago

Did you try --debug?