jacksonliam / mjpg-streamer

Fork of http://sourceforge.net/projects/mjpg-streamer/
2.96k stars 1.21k forks source link

Cannot change quality in mjpeg stream #369

Closed UraniumDonut closed 1 year ago

UraniumDonut commented 1 year ago

./mjpg_streamer -i "input_uvc.so -d /dev/video0 -n -r 1920x1080 -f 30" -o "./output_http.so -w ./www" With this command the stream works perfectly, but it uses 60 mbit/s for streaming. ./mjpg_streamer -i "input_uvc.so -d /dev/video0 -n -r 1920x1080 -f 30 -q 30" -o "./output_http.so -w ./www"

When I add the -q 30 the command stops working and outputs

 ---------------------------------------------------------------
 Help for input plugin..: UVC webcam grabber
 ---------------------------------------------------------------
 The following parameters can be passed to this plugin:

 [-d | --devi........ all the commands...

........gain control (auto or integer)
 ---------------------------------------------------------------

input_init() return value signals to exit 

The v4l2-ctl -d /dev/video0 --list-formats-ext output is:

        Type: Video Capture

        [0]: 'MJPG' (Motion-JPEG, compressed)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.017s (60.000 fps)
                Size: Discrete 1024x768
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.008s (120.101 fps)
                Size: Discrete 800x600
                        Interval: Discrete 0.017s (60.000 fps)
                Size: Discrete 1280x1024
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 320x240
                        Interval: Discrete 0.008s (120.101 fps)
        [1]: 'YUYV' (YUYV 4:2:2)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.111s (9.000 fps)
                Size: Discrete 1024x768
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 800x600
                        Interval: Discrete 0.050s (20.000 fps)
                Size: Discrete 1280x1024
                        Interval: Discrete 0.167s (6.000 fps)
                Size: Discrete 320x240
                        Interval: Discrete 0.033s (30.000 fps)

What can I do to lower the quality and lower the network usage?

jacksonliam commented 1 year ago

I don't think this is supported when pulling jpeg from the camera, the cameras don't support it.

You can run at a lower resolution or framerate (using softfps to drop frames from the stream for a lower framerate than your device supports)

Or you could use the -y flag and do jpeg encoding in the CPU, then the -q should work. But CPU usage will be a lot higher.