Scroll to navigation

USTREAMER(1) General Commands Manual USTREAMER(1)

NAME

ustreamer - stream MJPG video from any V4L2 device to the network

SYNOPSIS

ustreamer [OPTIONS]

DESCRIPTION

µStreamer (ustreamer) is a lightweight and very quick server to stream MJPG video from any V4L2 device to the network. All new browsers have native support of this video format, as well as most video players such as mplayer, VLC etc. µStreamer is a part of the Pi-KVM project designed to stream VGA and HDMI screencast hardware data with the highest resolution and FPS possible.

USAGE

Without arguments, ustreamer will try to open /dev/video0 with 640x480 resolution and start streaming on http://127.0.0.1:8080. You can override this behavior using parameters --device, --host and --port. For example, to stream to the world, run: ustreamer --device=/dev/video1 --host=0.0.0.0 --port=80

Please note that since µStreamer v2.0 cross-domain requests were disabled by default for security reasons. To enable the old behavior, use the option --allow-origin=\*.

For example, the recommended way of running µStreamer with Auvidea B101 on a Raspberry Pi is:

ustreamer \

--format=uyvy \ # Device input format
--encoder=omx \ # Hardware encoding with OpenMAX

--workers=3 \ # Maximum workers for OpenMAX
--persistent \ # Don´t re-initialize device on timeout (for example when HDMI cable was disconnected)
--dv-timings \ # Use DV-timings
--drop-same-frames=30 # Save the traffic
Please note that to use --drop-same-frames for different browsers you need to use some specific URL /stream parameters (see URL / for details).
You can always view the full list of options with ustreamer --help. Some features may not be available on your platform. To find out which features are enabled, use ustreamer --features.

OPTIONS

Capturing options

-d /dev/path, --device /dev/path
Path to V4L2 device. Default: /dev/video0.
Input channel. Default: 0.
Initial image resolution. Default: 640x480.
Image format. Available: YUYV, UYVY, RGB565, RGB24, JPEG; default: YUYV.
Force TV standard. Available: PAL, NTSC, SECAM; default: disabled.
Set V4L2 IO method (see kernel documentation). Changing of this parameter may increase the performance. Or not. Available: MMAP, USERPTR; default: MMAP.
Desired FPS. Default: maximum possible.
Drop frames smaller then this limit. Useful if the device produces small-sized garbage frames. Default: 128 bytes.
Don't re-initialize device on timeout. Default: disabled.
Enable DV timings querying and events processing to automatic resolution change. Default: disabled.
The number of buffers to receive data from the device. Each buffer may processed using an independent thread. Default: 2 (the number of CPU cores (but not more than 4) + 1).
The number of worker threads but not more than buffers. Default: 1 (the number of CPU cores (but not more than 4)).
Set quality of JPEG encoding from 1 to 100 (best). Default: 80. Note: If HW encoding is used (JPEG source format selected), this parameter attempts to configure the camera or capture device hardware's internal encoder. It does not re-encode MJPG to MJPG to change the quality level for sources that already output MJPG.
Use specified encoder. It may affect the number of workers.

CPU ─ Software MJPG encoding (default).

OMX ─ GPU hardware accelerated MJPG encoding with OpenMax (required WITH_OMX feature).

HW ─ Use pre-encoded MJPG frames directly from camera hardware.

NOOP ─ Don't compress MJPG stream (do nothing).

It doesn't do anything. Still here for compatibility. Required WITH_OMX feature.
Path to JPEG file that will be shown when the device is disconnected during the streaming. Default: black screen 640x480 with 'NO SIGNAL'.
Show the last frame received from the camera after it was disconnected, but no more than specified time (or endlessly if 0 is specified). If the device has not yet been online, display 'NO SIGNAL' or the image specified by option --blank. Note: currently this option has no effect on memory sinks. Default: disabled.
Slowdown capturing to 1 FPS or less when no stream or sink clients are connected. Useful to reduce CPU consumption. Default: disabled.
Timeout for device querying. Default: 1.
Delay before trying to connect to the device again after an error (timeout for example). Default: 1.

Image control options

Reset all image settings below to default. Default: no change.
Set brightness. Default: no change.
Set contrast. Default: no change.
Set saturation. Default: no change.
Set hue. Default: no change.
Set gamma. Default: no change.
Set sharpness. Default: no change.
Set backlight compensation. Default: no change.
Set white balance. Default: no change.
Set gain. Default: no change.
Set color effect. Default: no change.
Set vertical flip. Default: no change.
Set horizontal flip. Default: no change.

HTTP server options

Listen on Hostname or IP. Default: 127.0.0.1.
Bind to this TCP port. Default: 8080.
Bind to UNIX domain socket. Default: disabled.
Try to remove old unix socket file before binding. default: disabled.
Set UNIX socket file permissions (like 777). Default: disabled.
HTTP basic auth user. Default: disabled.
HTTP basic auth passwd. Default: empty.
Path to dir with static files instead of embedded root index page. Symlinks are not supported for security reasons. Default: disabled.
Don't send identical frames to clients, but no more than specified number. It can significantly reduce the outgoing traffic, but will increase the CPU loading. Don't use this option with analog signal sources or webcams, it's useless. Default: disabled.
Override image resolution for the /state. Default: disabled.
Set TCP_NODELAY flag to the client /stream socket. Ignored for --unix. Default: disabled.
Set Access-Control-Allow-Origin header. Default: disabled.
Timeout for client connections. Default: 10.

JPEG sink options

With shared memory sink you can write a stream to a file. See ustreamer-dump(1) for more info.

Use the specified shared memory object to sink JPEG frames. Default: disabled.
Set JPEG sink permissions (like 777). Default: 660.
Remove shared memory on stop. Default: disabled.
Client TTL. Default: 10.
Timeout for lock. Default: 1.

H264 sink options

Use the specified shared memory object to sink H264 frames encoded by MMAL. Default: disabled.
Set H264 sink permissions (like 777). Default: 660.
Remove shared memory on stop. Default: disabled.
Client TTL. Default: 10.
Timeout for lock. Default: 1.
H264 bitrate in Kbps. Default: 5000.
Intarval between keyframes. Default: 30.

Process options

Exit the program if the parent process is dead. Required HAS_PDEATHSIG feature. Default: disabled.
Set process name prefix which will be displayed in the process list like 'str: ustreamer --blah-blah-blah'. Required WITH_SETPROCTITLE feature. Default: disabled.
Send SIGUSR2 to the parent process when the stream parameters are changed. Checking changes is performed for the online flag and image resolution. Required WITH_SETPROCTITLE feature.

GPIO options

Available only if WITH_GPIO feature enabled.

Path to GPIO character device. Default: /dev/gpiochip0.
Consumer prefix for GPIO outputs. Default: ustreamer.
Set 1 on GPIO pin while µStreamer is running. Default: disabled.
Set 1 while streaming. Default: disabled.
Set 1 while stream has at least one client. Default: disabled.

Logging options

Verbosity level of messages from 0 (info) to 3 (debug). Enabling debugging messages can slow down the program. Available levels: 0 (info), 1 (performance), 2 (verbose), 3 (debug). Default: 0.
Enable performance messages (same as --log-level=1). Default: disabled.
Enable verbose messages and lower (same as --log-level=2). Default: disabled.
Enable debug messages and lower (same as --log-level=3). Default: disabled.
Force color logging. Default: colored if stderr is a TTY.
Disable color logging. Default: ditto.

Help options

Print this text and exit.
Print version and exit.
Print list of supported features.

SEE ALSO

ustreamer-dump(1)

BUGS

Please file any bugs and issues at https://github.com/pikvm/ustreamer/issues

AUTHOR

Maxim Devaev <mdevaev@gmail.com>

HOMEPAGE

https://pikvm.org/

COPYRIGHT

GNU General Public License v3.0

version 3.25 November 2020