Tutorials

Tutorials for Raspberry Pi

First of all, if you have never installed UV4L on Raspbian Wheezy or Raspbian Jessie, do it by following these instructions, otherwise upgrade UV4L to the latest version:

raspberrypi ~ $ sudo apt-get update
raspberrypi ~ $ sudo apt-get upgrade

Below is a list of some examples of how to use the UV4L suite of modules in combination with third-party applications and/or with the integrated components (such as the UV4L Streaming Server). Although each example makes use of a specific UV4L input driver for demo purposes, all of the examples should work with any input driver in most cases.

To show you the examples from the top to the bottom, in some cases we will assume that you have not installed the uv4l-raspicam-extras optional package, which provides a system service that automatically loads all the installed UV4L modules at boot.

In general, you can start uv4l as many times as you want (each one creating a its own device node and streaming server instance). Since uv4l runs in user space, remember that, in all the cases, to “unload” uv4l, it’s enough to kill the corresponding system process. Almost all the examples have been originally tested on the (old) Raspberry Pi 1 and Compute Module 1, but will work with every Raspberry Pi model.

  1. Record an H264 video at full 1920×1080 resolution, 30 fps
  2. Motion
  3. Capture and display with OpenCV
  4. Use the Camera Board on the Rpi as a (virtual) camera plugged into another PC
  5. Set up a real-time Streaming Server (RTSP)
  6. FFmpeg Server & avconv
  7. Setup an RTMP Server (in H264 full res, 30fps) with crtmpserver and FFMpeg
  8. Full fps, Live Text Overlay (over video)
  9. Real-time Object Detection and Object Tracking
  10. Real-time HTTP/HTTPS Streaming Server with the native uv4l-server module
  11. Compute Module: stereoscopic vision
  12. Compute Module: use Dual Cameras separately
  13. Start or Join a Multi Peer-to-Peer Audio/Video Conference with WebRTC
  14. Live Desktop & Audio Streaming to the browser with WebRTC
  15. How to broadcast or have bidirectional live audio and video conferences to/in a Jitsi Meet Room over the Web
  16. Webinars and Video Conferences in Full HD with the Janus WebRTC Gateway
  17. UV4L for the Internet of Things with WebRTC Data Channels
  18. Turn any MJPEG stream (e.g. from an IP camera) into a virtual camera
  19. Example of custom web app in HTML5 and plain JavaScript: face detection on a video stream from a camera in the network
  20. Screen and audio mirroring to the Raspberry Pi