how to use raspberry pi camera as a webcam

How to Use Your Raspberry Pi Camera as a Webcam? (Zoom Demo)

If you click our links and make a purchase, we may earn an affiliate commission. Learn more

I recently turned my Raspberry Pi camera into a webcam for Zoom, mostly out of curiosity at first. I expected it to be complicated, but once I figured out the right streaming setup, it worked surprisingly well. If you want to reuse your Pi camera for video calls, I’ll show you the easiest method I found.

The Raspberry Pi camera module can be used as a webcam on a computer, by streaming the camera on the network. The camera will act as an IP camera and can be used as a webcam on applications like Zoom.

Keep reading this step-by-step tutorial to know how to use your Raspberry Pi Camera as a webcam. And as you’ll see, it’s straightforward, you only need the right tools on your computer and on your Raspberry Pi.

If you’re new to Raspberry Pi or Linux, I’ve got something that can help you right away!
Download my free Linux commands cheat sheet – it’s a quick reference guide with all the essential commands you’ll need to get things done on your Raspberry Pi. Click here to get it for free!

Hardware Prerequisites for Raspberry Pi Webcam

Let’s start by making sure you have everything you need:

  • A Raspberry Pi, with an up-to-date operating system.
  • A camera, configured correctly.
  • The application we’ll use to stream the camera on the network.

We’ll go over the hardware in this section and the software in the next.

Hardware to Get

All Raspberry Pi models include a port to plug a camera module, so you can use any model you have at your disposal.

It might be slightly easier with a Raspberry Pi 3B+ or 4 but use the model you have, no problem. You can even repurpose old hardware to use as a webcam for your Raspberry Pi.

Here are my current recommendations if don’t have everything yet:

Plug the Camera In

You probably know how to do this if you have a camera, but don’t forget to plug it correctly on your Raspberry Pi. Remove the slot protector and plug the cable in as shown in this picture:

Something not working as expected?
You can get answers from real experts in minutes.
Get help with your setup
camera cable raspberry pi

If you need step-by-step instructions on how to do this, you can check my dedicated tutorial on how to set up a camera on Raspberry Pi.

Software Prerequisites for Raspberry Pi Webcam

OK, now that you’ve got the hardware, you’re ready to install the key software, which is an operating system and the streaming software.

Recommended next step
Master Raspberry Pi in 30 Days

If you want a clearer path than jumping from tutorial to tutorial, my book gives you a step-by-step roadmap to really understand your Raspberry Pi.

Check the book here

Install Operating System

The easiest way to follow this tutorial will be to use the Raspberry Pi OS distribution. So if you don’t have it yet, I recommend installing it now. I have an entire guide on how to install Raspberry Pi OS on Raspberry Pi, so I will not repeat everything here.

You can pick any Raspberry Pi OS version you want. The Lite version is enough, but using a Desktop version might help for debugging purposes. I’ll give you the instructions for the Lite version, if you are on Desktop, open a terminal and follow the same steps.

Before going further you need to:

  • Install Raspberry Pi OS by following the tutorial if needed.
    I’m doing this on Raspberry Pi OS Bullseye, but it’s the same thing with any version.
  • Connect the Raspberry Pi to your network (Ethernet or Wi-Fi).
    In most cases, Ethernet will be connected automatically with your DHCP server.
    To connect to a Wi-Fi network, you can use raspi-config:
    sudo raspi-config
    Then go to System options > Wireless LAN.
  • Update the Raspberry Pi OS packages to the latest version:
    sudo apt update
    sudo apt upgrade
    sudo reboot
  • Enable SSH: It’s often easier to do everything from your computer (via SSH), instead of typing everything on the Raspberry Pi. To enable it on your Raspberry Pi, you can use raspi-config:
    sudo raspi-config
    Then go to Interface Options > SSH, and answer “Yes”.
    You can now use SSH to follow the next part of this tutorial.

That’s it, you are ready to start!

Tip: Command lines can be a pain to memorize. I put the essential Linux commands on a printable cheat sheet so you don't have to keep googling them. You can grab the PDF here if you want to save some time.

Configure the Pi Camera

In recent versions of Raspberry Pi OS, the camera is now enabled by default, so it should work right away. You can do a quick check with:
rpicam-hello

It should start the camera preview stream and display the camera view on your screen.

Note: If you run an old version of Raspberry Pi OS, you may need to enable it first. You can do this via raspi-config > Interface Options.

If you experience any issues with the camera installation, or for any reason, it doesn’t work as expected, please check this troubleshooting guide for the Raspberry Pi camera module.

Install Camera Streamer Software

We need a software that can stream the camera over the network (IP camera). For this guide, we’ll be using Motion, a powerful software that can do that and a lot more with your camera.

Install Motion

To use it, follow this procedure:

  • Install Motion and the required dependencies from the default repository:
    sudo apt install motion libavcodec-dev libavformat-dev libavutil-dev libjpeg-dev libjpeg62-turbo-dev libpq-dev libswresample-dev
    Answer “Yes” to install all of them.
  • Next, you need to configure Motion. The configuration is not intuitive at all, but you can download a configuration template from here:
    wget https://www.dropbox.com/s/6ruqgv1h65zufr6/motion-mmal-lowflyerUK-20151114.tar.gz
  • Extract the files from the archive:
    tar -zxvf motion-mmal-lowflyerUK-20151114.tar.gz
  • Feel free to check and adjust the settings in the motion-mmalcam-both.conf file to fit your camera needs (image height and width, for example).
  • Start Motion with our configuration template:
    sudo motion -c motion-mmalcam-both.conf

It will start up and then run as a listening server.
To finish up our installation, let’s check if the video stream is actually working.

Check the Video Stream

The live stream is available in HTTP, by using the Raspberry Pi IP address and the port 8081.
Open your web browser and go to http://<RASPBERRY_IP>:8081.

Check that you can see the live stream correctly, with sufficient quality.
Now that you can see the live steam, you can adjust the Motion configuration again (for example, mine is never in the correct sens, I have to rotate the image).

The goal of this tutorial is not to explain to you how to configure Motion.
But you can find all the resources needed on their GitHub page.

Access the Raspberry Pi Camera Stream on Your PC

We now have your live stream working, and we need to use another software on the computer to relay the camera image in a video call.

Also: I've tested hundreds of Linux apps, here are the ones I recommend.

My Software Recommendation: SplitCam

SplitCam is the software we’ll use to turn your IP camera into a webcam on the PC.
SplitCam allows, among other things, to create a virtual camera on your computer and send an IP camera to flow into it.

We’ll use this software to have the Pi camera available on Zoom (or other video conferencing software), even if we don’t actually have a physical camera on the PC itself.

Download & Install SplitCam

SplitCam is a free software for Windows, you can download it from the official website.

Installation

To install it on your computer, follow this procedure:

  • Double-click on the file you just downloaded.
  • Keep the default values (“Next”, “Next”, “Next”).
  • At the end of the installation, you can close the setup wizard.
    SplitCam should be available in your main menu.

Configuration

  • You can now start SplitCam.
  • The first time it runs, quit the setup wizard, because we want to do something else.
  • On the left, you’ll see a list of Media Layers, click the + icon to add a new source.
    From the drop-down list, select IP Camera.
  • You’ll get something like this:
  • Then in the URL field, enter the live stream URL.
    For example: http://192.168.1.17:8081
    Click Add.
  • After a few seconds, a new entry will appear in the list and the video feed in the main window.

If you experience any issues, double-check the Raspberry Pi IP address and make sure that Motion is still running on the Raspberry Pi. Restarting SplitCam also fixed an issue on my side, so maybe you can try this if it doesn’t display the live stream.

You’re almost ready, you just need to configure your video call software now.

Zoom Configuration

I’ll show you how to use it on Zoom, as it’s one the most used tools for this.
But it’s the same thing with any software:

  • Launch Zoom.
  • Click on the cog icon to open the Settings menu.
  • Go to the “Video & effects” section.
  • In the Camera section, make sure that the “SplitCam Video Driver” is selected:
  • You can check the camera image preview to see that its’ working.
    Now you’re ready to use your Raspberry Pi camera as a classic webcam.

🛠 This tutorial doesn't work anymore? Report the issue here, so that I can update it!

Stuck on this project? Ask me or other Pi users in the RaspberryTips Community. We help each other out and you'll get answers quick. Join and fix it together.

Related Questions

How do I auto-start Motion on boot?

We use a specific configuration file and command to start motion temporarily, but you can move the files to the default folders to configure it as a daemon.
Here is how to do this:
sudo mkdir /var/log/motion
sudo chown motion /var/log/motion
sudo mv motion-mmalcam-both.conf /etc/motion.conf

Then enable the service to make it start automatically on boot:
sudo systemctl enable motion

That’s it, you now know how to use your Raspberry Pi camera as a webcam on any computer software. I hope it was useful for you and that I saved you some money.

If you want to get more ideas on what you can do with a camera, check my article about 11 projects ideas to do with a camera on Raspberry Pi.

Not getting the same result?

Even when you follow every step, small differences in OS version, hardware or config can change the outcome. Instead of wasting time guessing, get help from people who have already fixed the same kind of issue.

Ask your question now →
🔒 No risk. Cancel anytime.
  • Get help on your exact issue
  • Access step-by-step videos for tricky setups
  • Browse the website without ads

Similar Posts

17 Comments

  1. I am trying to use my raspberry pi camera as a webcam camera.right now im stuck trying to install the libswresample-dev package but it keeps giving an error. I hope someone can help answer this. Thanks.

      1. So i went to the motion github (https://motion-project.github.io/motion_build.html) and installed the abbreviated building guide along with the libraries that need to be installed that are under that. All of that worked and I was able to enable the camera driver and check that the camera was on. I also downloaded the configuration and extracted the files. However, when it tried to start it it got an error.

        sudo: motion: command not found

  2. sudo mv motion-mmalcam.conf /etc/motion.conf
    should be
    sudo mv motion-mmalcam-both.conf /etc/motion.conf

  3. I got to the very end, but all I see in the split cam app a loading screen of 5 blue dots crashing into each other. Is my camera not installed properly or incompatible? The camera I am using is one that shipped with the Pi so I doubt it’s incompatible

    1. I had the same problem at first, for me the problem was that I had to write”http://” befor the IP-address.

  4. I have tried this way and another method at this point, and neither have worked. For some reason, the “stream” either is just captured jpegs, or it is just running at very low frames. Please help. D:

  5. Hurray
    I could able to do it.. But unfortunately splitCam application is not stable, crashes many times, fails to connect many times.

  6. Sorry but I messed it up
    After doing
    sudo mv motion /usr/bin/motion
    sudo mv motion-mmalcam-both.conf /etc/motion.conf
    Camera is not starting after reboot
    When I tried manually I’m unable to do that
    why I redone all the steps again, I got this message:
    pi@raspberrypi:~ $ sudo motion -c motion-mmalcam-both.conf
    motion: error while loading shared libraries: libavformat.so.56: cannot open shared object file: No such file or directory

  7. I Don’t know if splitcam.exe should be installed in the Raspberry Pi. In this case which application should I use for it? I Don’t know how to do with the. exe file to install splitcam in my Rasp

    1. Hello,

      No, you need to install Splitcam on your computer
      And connect to the Pi Camera with the URL

Leave a Reply

Community members only
Comments are reserved for RaspberryTips Community members. Join the community to ask questions, get help, and interact with other Raspberry Pi users.

Join the community  or  log in