datrixs / datrix-ustreamer

datrix-ustreamer is based on the ustreamer project and ported to Rockchip.
GNU General Public License v3.0
1 stars 1 forks source link

datrix-uStreamer

datrix-ustreamer is based on the ustreamer project and ported to Rockchip.


Installation

Building

You need to download the µStreamer onto your system and build it from the sources.

Preconditions

You'll need make, gcc, libevent with pthreads support, libjpeg9/libjpeg-turbo and libbsd (only for Linux).

To enable GPIO support install libgpiod and pass option WITH_GPIO=1. If the compiler reports about a missing function pthread_get_name_np() (or similar), add option WITH_PTHREAD_NP=0 (it's enabled by default). For the similar error with setproctitle() add option WITH_SETPROCTITLE=0.

Note Raspian: In case your version of Raspian is too old for there to be a libjpeg9 package, use libjpeg8-dev instead: E: Package 'libjpeg9-dev' has no installation candidate.

Make

The most convenient process is to clone the µStreamer Git repository onto your system.

$ git clone --depth=1 https://github.com/datrixs/datrix-ustreamer
$ cd ustreamer
$ make
$ ./ustreamer --help

Update

Assuming you have a µStreamer clone as discussed above you can update µStreamer as follows.

$ cd ustreamer
$ git pull
$ make clean
$ make

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

:exclamation: 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=\*.

EDID

Add -e EDID=1 to set HDMI EDID before starting ustreamer. Use together with -e EDID_HEX=xx to specify custom EDID data.


Integrations

Janus

µStreamer supports bandwidth-efficient streaming using H.264 compression and the Janus WebRTC server. See the Janus integration guide for full details.

Nginx

When uStreamer is behind an Nginx proxy, it's buffering behavior introduces latency into the video stream. It's possible to disable Nginx's buffering to eliminate the additional latency:

location /stream {
    postpone_output 0;
    proxy_buffering off;
    proxy_ignore_headers X-Accel-Buffering;
    proxy_pass http://ustreamer;
}

Tips & tricks for v4l2

v4l2 utilities provide the tools to manage USB webcam setting and information. Scripts can be use to make adjustments and run manually or with cron. Running in cron for example to change the exposure settings at certain times of day. The package is available in all Linux distributions and is usually called v4l-utils.

Here you can find more examples. Documentation is available in man v4l2-ctl.


See also

Special thanks