webrtcH4cKS has recently posted a very interesting article about a computer vision project that makes use of UV4L for real-time streaming of video and data over WebRTC from a Raspberry Pi Zero connected to a AIY Vision board. The board embeds a Vision Processing Unit (VPU) chip that runs Tensor Flow image processing graphs super efficiently.
The article is divided in two parts:
The Video4Linux2 uv4l-raspicam driver for Raspberry Pi has been extended to support the TC358743 HDMI to MIPI converter chip. This chipset is often found in the B101 capture boards made by Auvidea.
Any resolution, color space or hardware codec (like MJPEG, H264, YUVs, etc…, with or without preview) will work. All the UV4L components on the top of this driver will work as usual.
The Raspberry Pi 3 is supported by this new release of the raspicam driver, while support for other Raspberry Pi models can be activated upon request.
Upgrade the driver or read these instructions to know how to install it. Remember that the TC358743 in the driver has to be enabled via the –tc358743=yes option (e.g. in the configuration file) to use it.
The UV4L WebRTC extension is finally available for the following models as well: Raspberry Pi 1, Raspberry Pi Zero and Raspberry Pi Zero W (Wireless).
For the installation instructions click here.
Remember that these models have less CPU power than the Raspberry Pi 2 and 3 counterparts, so please consider experimenting with “modest” resolutions first.
Users of other Rpi models, however, are also suggested to upgrade the UV4L packages to the most recent release as includes general improvements and new options, especially for the Streaming Server module and the raspicam driver (e.g. it’s now possible to disable image processing blocks in the ISP).
An unique embedded 3D immersive telepresence over the web solution based on the UV4L framework with the following features is now ready:
- optionally two-way, encrypted live data-audio-video in HD or greater resolution at full frame rate between two participants (or even more)
- FPV in a 180° x 180° panorama
- 3D Stereo image (optional)
- real-time head tracking, working out-of-the-box with any smartphone (no special software required, e.g. plugin-free browser) inside a VR headset like Google cardboards or easily adaptable to dedicate hardware like Oculus or OSVR
- software based on standard technology
- over Internet (cloud) or LAN
- peer-to-peer or video rooms with multiple participants
- does not necessarily require any third-party server infrastructure…
- …but can be optionally easily made as on-demand service when put in the cloud
- easy NAT traversal
- audio-video on-the-fly recording & play back on the browser client or recording on server side for further post-processing
- adaptive bitrate streaming to available bandwidth
- very low CPU usage
- single board, low cost
The VideoConference DEMO OS has been updated to include, by default, the recent raspidisp module addition to the UV4L suite, which allows your (potentially headless) Raspberry Pi to be mirrored and controlled from within any browser on your PC or SmartPhone. Another new interesting possibility coming out from this new module is that you can now broadcast your Rpi screen to other people over the web.
It’s called raspidisp (for Raspberry Pi) and can turn a given display output into a Video4Linux-compliant capture device (like a camera). The UV4L Streaming Server itself makes use of it in a new functionality which allows to both mirror the RPi display and send keyboard or mouse inputs to the Rpi from a web page in the PC browser (it works with smarpthones too, except the keyboard is not supported at the moment) – plugin-free! As UV4L can capture audio too, adding an audio track (e.g. from HDMI-out) is left as an exercise to the user. Below is a DEMO.
It’s quite easy to try this out by yourself as does not require any special configuration. Please refer to the installation page for the instructions.
A new release of UV4L is out with a new “tiny” feature. You can now capture and record the audio/video live stream from the remote peer (e.g. a Raspberry Pi) into a standard webm container, that you can play back later or save to disk. All this can be done from within your browser at the usual /stream/webrtc web page (there’s a start/stop recording button right below the video box). As usual, this does not require any additional plug-in. With regard to the Raspberry Pi this means that you can easily record Full HD audio/videos at 30fps.
These are the projects currently in preparation:
- For Raspberry Pi: screen and audio sharing with the browser. It will be possible to fully control the screen (by screen we mean whatever you would see on a HDMI display directly attached to the Rpi, not just the desktop) from any browser (with no additional plug-in) from a smartphone, PC or tablet, etc… with mouse and keyboard. This solution can completely replace RealVNC.
- For the Raspberry Pi Compute Module with a Dual Camera: real-time, high resolution, 30fps stereo depth maps directly to the browser.
- (*) An unique, magic thing that we are not sure we want to tell now.
As promised, the announced RESTful API over HTTP and HTTPS is now ready! What does it mean? As a developer, it allows you to easily write your custom application in your preferred language and make use of a great part of the UV4L functionalities from within the application itself. At the moment, for example, the API makes it possible to change all the Streaming Server settings on-the-fly and fully drive a Janus client session in fine-grained detail.
From the user’s perspective support for Janus is not something new in UV4L (here is an old introduction), but as a developer you gain access to many more interesting features, such as dynamic audio/video recording, max. bitrate selection, audio and video codec selection between vp8, vp9, and hardware-encoded h264 in high resolution, mute/unmute, etc…not counting that you can create or destroy or list existing rooms on a server, list the participants of a room, and so on…
The documentation of the API is work-in-progress (keep an eye on it), but a panel for testing the API now is directly available as a web page at the UV4L Streaming Server.
If you want to quickly test the API with a fully working, self-enclosed environment, download and try out the updated release of the VideoConference DEMO OS for Raspberry Pi.
As usual, please see these installation instructions to know how to install UV4L on a Raspberry Pi. Packages for x86 will be available soon.