Using the new 12MP Pi cam for video conferencing on your desktop

So you got that awesome new Raspberry Pi High-Res camera that they released last week but you don’t really know what to do with it ?

Well, there is salvation, Ubuntu Core can turn it for you into a proper streaming device and help you with using it for your Zoom meetings giving you a really professional look !

What you need:

  • A Raspberry Pi 3 (2 will work too but you need ethernet or a wlan dongle)
  • An SD card
  • The new High Quality Camera
  • A C-Mount or CS-Mount lens
  • A tripod/stand (optional but really helpful)

Setting up the Pi:

Attach the camera to the CSI port of the Raspberry Pi.

Download the Ubuntu Core 18 image and write it to an SD card.

Boot the Pi with keyboard/monitor attached and run though the setup wizard to create a User and configure the WLAN.

Now ssh into the pi like it tells you to on the screen.

On the Pi you do:

$ snap set system pi-config.start-x=1
$ snap install picamera-streaming-demo
$ sudo reboot # to make the start-x setting above take effect

This is it for the Pi side, you can check that the setup worked by pointing your browser to (replace IP_OF_YOUR_PI with the actual IP address):


You should see the picture of the camera in your browser…

The PC side:

To make your stream from your newly created Ubuntu Core network camera available to your video conferencing applications on the desktop we need to teach it to show up on your PC as a v4l /dev/video device.

Luckily the linux kernel has the awesome v4l2loopback module that helps with this, lets install it on the PC:

$ sudo apt install v4l2loopback-dkms
... [ some compiling ] ...
$ ls /dev/video*
/dev/video0  /dev/video1  /dev/video2
$ sudo modprobe v4l2loopback
$ ls /dev/video*
/dev/video0  /dev/video1  /dev/video2  /dev/video3

Loading the module created a new /dev/video3 device that we will use …

Now we need to capture the stream from the pi and route it into this /dev/video3 device, to do this we will use ffmpeg (replace IP_OF_YOUR_PI with the actual IP address):

$ sudo snap install ffmpeg
$ sudo snap connect ffmpeg:camera
$ sudo ffmpeg -re -i http://IP_OF_YOR_PI:8000/stream.mjpg -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video3

And thats it …

If you do not yet have any video conferencing software, try out the zoom-client snap …

$ sudo snap install zoom-client

Set up an account and select the “Dummy Camera Device” in the Video Input Settings.

The whole thing will then look like (hopefully with a less ugly face in it though 🙂 ):


And this is it … the camera quality is classes better than anything you get with a similar priced USB camera or builtin laptop one and you can replace the lens with a wider angle one etc …

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s