forked from pikvm/ustreamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathustreamer.1
285 lines (261 loc) · 10.7 KB
/
ustreamer.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
.\" Manpage for ustreamer.
.\" Open an issue or pull request to https://github.com/pikvm/ustreamer to correct errors or typos
.TH USTREAMER 1 "version 2.2" "November 2020"
.SH NAME
ustreamer \- stream MJPG video from any V4L2 device to the network
.SH SYNOPSIS
.B ustreamer
.RI [OPTION]
.SH DESCRIPTION
µStreamer (\fBustreamer\fP) 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.
.SH USAGE
Without arguments, \fBustreamer\fR will try to open \fB/dev/video0\fR with 640x480 resolution and start streaming on \fBhttp://127\.0\.0\.1:8080\fR\. You can override this behavior using parameters \fB\-\-device\fR, \fB\-\-host\fR and \fB\-\-port\fR\. For example, to stream to the world, run: \fBustreamer --device=/dev/video1 --host=0.0.0.0 --port=80\fR
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 \fB\-\-allow\-origin=\e*\fR\.
For example, the recommended way of running µStreamer with Auvidea B101 on a Raspberry Pi is:
\fBustreamer \e\fR
.RS
\fB\-\-format=uyvy \e\fR # Device input format
.nf
\fB\-\-encoder=omx \e\fR # Hardware encoding with OpenMAX
.nf
\fB\-\-workers=3 \e\fR # Maximum workers for OpenMAX
.nf
\fB\-\-persistent \e\fR # Don\'t re\-initialize device on timeout (for example when HDMI cable was disconnected)
.nf
\fB\-\-dv\-timings \e\fR # Use DV\-timings
.nf
\fB\-\-drop\-same\-frames=30\fR # Save the traffic\fR
.RE
.P
Please note that to use \fB\-\-drop\-same\-frames\fR for different browsers you need to use some specific URL \fB/stream\fR parameters (see URL \fB/\fR for details)\.
.P
You can always view the full list of options with \fBustreamer \-\-help\fR\. Some features may not be available on your platform. To find out which features are enabled, use \fBustreamer \-\-features\fR.
.SH OPTIONS
.SS "Capturing options"
.BR \-d\ \fI/dev/path ", " \-\-device\ \fI/dev/path
Path to V4L2 device. Default: /dev/video0.
.TP
.BR \-i\ \fIN ", " \-\-input\ \fIN
Input channel. Default: 0.
.TP
.BR \-r\ \fIWxH ", " \-\-resolution\ \fIWxH
Initial image resolution. Default: 640x480.
.TP
.BR \-m\ \fIfmt ", " \-\-format\ \fIfmt
Image format.
Available: YUYV, UYVY, RGB565, RGB24, JPEG; default: YUYV.
.TP
.BR \-a\ \fIstd ", " \-\-tv\-standard\ \fIstd
Force TV standard.
Available: PAL, NTSC, SECAM; default: disabled.
.TP
.BR \-I\ \fImethod ", " \-\-io\-method\ \fImethod
Set V4L2 IO method (see kernel documentation). Changing of this parameter may increase the performance. Or not.
Available: MMAP, USERPTR; default: MMAP.
.TP
.BR \-f\ \fIN ", " \-\-desired\-fps\ \fIN
Desired FPS. Default: maximum possible.
.TP
.BR \-z\ \fIN ", " \-\-min\-frame\-size\ \fIN
Drop frames smaller then this limit. Useful if the device produces small\-sized garbage frames. Default: 128 bytes.
.TP
.BR \-n ", " \-\-persistent
Don't re\-initialize device on timeout. Default: disabled.
.TP
.BR \-t ", " \-\-dv\-timings
Enable DV timings querying and events processing to automatic resolution change. Default: disabled.
.TP
.BR \-b\ \fIN ", " \-\-buffers\ \fIN
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).
.TP
.BR \-w\ \fIN ", " \-\-workers\ \fIN
The number of worker threads but not more than buffers.
Default: 1 (the number of CPU cores (but not more than 4)).
.TP
.BR \-q\ \fIN ", " \-\-quality\ \fIN
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.
.TP
.BR \-c\ \fItype ", " \-\-encoder\ \fItype
Use specified encoder. It may affect the number of workers.
CPU ─ Software MJPG encoding (default).
OMX ─ GPU hardware accelerated MJPG encoding with OpenMax (required \fBWITH_OMX\fR feature).
HW ─ Use pre-encoded MJPG frames directly from camera hardware.
NOOP ─ Don't compress stream. Useful for the RAW sink.
.TP
.BR \-g\ \fIWxH,... ", " \-\-glitched\-resolutions\ \fIWxH,...
Comma-separated list of resolutions that require forced
encoding on CPU instead of OMX. Required \fBWITH_OMX\fR feature. Default: disabled.
.TP
.BR \-k\ \fIpath ", " \-\-blank\ \fIpath
Path to JPEG file that will be shown when the device is disconnected during the streaming. Default: black screen 640x480 with 'NO SIGNAL'.
.TP
.BR \-K\ \fIsec ", " \-\-last\-as\-blank\ \fIsec
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. Default: disabled.
.TP
.BR \-\-device\-timeout\ \fIsec
Timeout for device querying. Default: 1.
.TP
.BR \-\-device\-error\-delay\ \fIsec
Delay before trying to connect to the device again after an error (timeout for example). Default: 1.
.SS "Image control options"
.BR \-\-image\-default
Reset all image settings bellow to default. Default: no change.
.TP
.BR \-\-brightness\ \fIN ", " \fIauto ", " \fIdefault
Set brightness. Default: no change.
.TP
.BR \-\-contrast\ \fIN ", " \fIdefault
Set contrast. Default: no change.
.TP
.BR \-\-saturation\ \fIN ", " \fIdefault
Set saturation. Default: no change.
.TP
.BR \-\-hue\ \fIN ", " \fIauto ", " \fIdefault
Set hue. Default: no change.
.TP
.BR \-\-gamma\ \fIN ", " \fIdefault
Set gamma. Default: no change.
.TP
.BR \-\-sharpness\ \fIN ", " \fIdefault
Set sharpness. Default: no change.
.TP
.BR \-\-backlight\-compensation\ \fIN ", " \fIdefault
Set backlight compensation. Default: no change.
.TP
.BR \-\-white\-balance\ \fIN ", " \fIauto ", " \fIdefault
Set white balance. Default: no change.
.TP
.BR \-\-gain\ \fIN ", " \fIauto ", " \fIdefault
Set gain. Default: no change.
.TP
.BR \-\-color\-effect\ \fIN ", " \fIdefault
Set color effect. Default: no change.
.TP
.BR \-\-flip\-vertical\ \fI1 ", " \fI0 ", " \fIdefault
Set vertical flip. Default: no change.
.TP
.BR \-\-flip\-horizontal\ \fI1 ", " \fI0 ", " \fIdefault
Set horizontal flip. Default: no change.
.SS "HTTP server options"
.BR \-s\ \fIaddress ", " \-\-host\ \fIaddress
Listen on Hostname or IP. Default: 127.0.0.1.
.TP
.BR \-p\ \fIN ", " \-\-port\ \fIN
Bind to this TCP port. Default: 8080.
.TP
.BR \-U\ \fIpath ", " \-\-unix\ \fIpath
Bind to UNIX domain socket. Default: disabled.
.tp
.br \-d ", " \-\-unix\-rm
try to remove old unix socket file before binding. default: disabled.
.TP
.BR \-M\ \fImode ", " \-\-unix\-mode\ \fImode
Set UNIX socket file permissions (like 777). Default: disabled.
.TP
.BR \-\-user\ \fIname
HTTP basic auth user. Default: disabled.
.TP
.BR \-\-passwd\ \fIstr
HTTP basic auth passwd. Default: empty.
.TP
.BR \-\-static\ \fIpath
Path to dir with static files instead of embedded root index page. Symlinks are not supported for security reasons. Default: disabled.
.TP
.BR \-e\ \fIN ", " \-\-drop\-same\-frames\ \fIN
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.
.TP
.BR \-l ", " \-\-slowdown
Slowdown capturing to 1 FPS or less when no stream clients are connected. Useful to reduce CPU consumption. Default: disabled.
.TP
.BR \-R\ \fIWxH ", " \-\-fake\-resolution\ \fIWxH
Override image resolution for the /state. Default: disabled.
.TP
.BR \-\-tcp\-nodelay
Set TCP_NODELAY flag to the client /stream socket. Ignored for \-\-unix.
Default: disabled.
.TP
.BR \-\-allow\-origin\ \fIstr
Set Access\-Control\-Allow\-Origin header. Default: disabled.
.TP
.BR \-\-server\-timeout\ \fIsec
Timeout for client connections. Default: 10.
.SS "RAW sink options"
Available only if \fBWITH_RAWSINK\fR feature enabled.
.TP
.BR \-\-raw\-sink\ \fIname
Use the specified shared memory object to sink RAW frames before encoding.
Most likely you will never need it. Default: disabled.
.TP
.BR \-\-raw\-sink\-mode\ \fImode
Set RAW sink permissions (like 777). Default: 660.
.TP
.BR \-\-raw\-sink\-rm
Remove shared memory on stop. Default: disabled.
.TP
.BR \-\-raw\-sink\-timeout\ \fIsec
Timeout for lock. Default: 1.
.SS "Process options"
.BR \-\-exit\-on\-parent\-death
Exit the program if the parent process is dead. Required \fBHAS_PDEATHSIG\fR feature. Default: disabled.
.TP
.BR \-\-process\-name\-prefix\ \fIstr
Set process name prefix which will be displayed in the process list like '\fIstr: ustreamer \-\-blah\-blah\-blah'\fR. Required \fBWITH_SETPROCTITLE\fR feature. Default: disabled.
.TP
.BR \-\-notify\-parent
Send SIGUSR2 to the parent process when the stream parameters are changed. Checking changes is performed for the online flag and image resolution. Required \fBWITH_SETPROCTITLE\fR feature.
.SS "GPIO options"
Available only if \fBWITH_GPIO\fR feature enabled.
.TP
.BR \-\-gpio\-device\ \fI/dev/path
Path to GPIO character device. Default: /dev/gpiochip0.
.TP
.BR \-\-gpio\-consumer\-prefix\ \fIstr
Consumer prefix for GPIO outputs. Default: ustreamer.
.TP
.BR \-\-gpio\-prog\-running\ \fIpin
Set 1 on GPIO pin while µStreamer is running. Default: disabled.
.TP
.BR \-\-gpio\-stream\-online\ \fIpin
Set 1 while streaming. Default: disabled.
.TP
.BR \-\-gpio\-has\-http\-clients\ \fIpin
Set 1 while stream has at least one client. Default: disabled.
.SS "Logging options"
.BR \-\-log\-level\ \fIN
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.
.TP
.BR \-\-perf
Enable performance messages (same as \-\-log\-level=1). Default: disabled.
.TP
.BR \-\-verbose
Enable verbose messages and lower (same as \-\-log\-level=2). Default: disabled.
.TP
.BR \-\-debug
Enable debug messages and lower (same as \-\-log\-level=3). Default: disabled.
.TP
.BR \-\-force\-log\-colors
Force color logging. Default: colored if stdout is a TTY.
.TP
.BR \-\-no\-log\-colors
Disable color logging. Default: ditto.
.SS "Help options"
.BR \-h ", " \-\-help
Print this text and exit.
.TP
.BR \-v ", " \-\-version
Print version and exit.
.TP
.BR \-\-features
Print list of supported features.
.SH BUGS
Please file any bugs and issues at \fIhttps://github.com/pikvm/ustreamer/issues\fR
.SH AUTHOR
Maxim Devaev <[email protected]>
.SH HOMEPAGE
\fIhttps://pikvm.org/\fR
.SH COPYRIGHT
GNU General Public License v3.0