Configuring a Canon camera as a webcam in Ubuntu
08 Aug 2023In recent weeks, I found myself facing a common challenge: transforming my Canon M50 into a functional webcam on Ubuntu. While Canon offers a straightforward solution, the EOS Webcam Utility for Windows users, Ubuntu lacks native support. Fear not, for alternatives do exist. In this guide, I’ll delve into the process of utilizing your Canon camera as a webcam.
Hardware needed
First, you will need any Canon camera, plus a micro-USB cable. The battery of your camera may drain very fast, so it’s also nice to have a dummy battery. I’m using this model from Aliexpress, but there are other options, like some ones plugged directly into the power socket. The dummy battery may be different depending on your camera model, so make sure to check it before buying.
Camera configurations
Begin by disabling the Eco mode on your Canon M50. This precaution prevents the camera from automatically powering off during use. On Canon M50, go to the wrench option, then you will find the Eco mode option on the second page. Switch it to Off.
Installng dependencies
These are the needed packages:
Create a script file
I find it more useful and less error-prone to have the commands needed to start the camera on a script file. So, create a file called start-canon.sh
with the following content:
You may need to change the resolution of the video, under the -s:v
parameter. You can also change the device name, if you want, in card_label parameter.
I have also applied a filter to the video, to reduce the noise. You can remove it if you want. The filter is applied with the -af
parameter.
Since I’m using a laptop, the camera is mounted in /dev/video2
. If you are using a desktop, it may be mounted in /dev/video0
or /dev/video1
. You can check the device name with the command v4l2-ctl --list-devices
.
Then, plug the camera on the USB port, change the camera to video mode, and run the script:
Using the camera as a webcam
Now, you can use the camera as a webcam. You can use it in Zoom, Google Meet, or any other software that uses the webcam. You can also use it in VLC, by opening the device as listed on the gphoto2
command.