Raspberry Pi Autofo...
Clear all

Raspberry Pi Autofocus Camera & libcamera

DroneBot Workshop
Workshop Guru Admin
Joined: 3 years ago
Posts: 1096
Topic starter  

Today we’ll be looking at an autofocus camera for the Raspberry Pi. We’ll also learn to use libcamera to take pictures, videos and to stream video.

Today we’ll take a look at a Raspberry Pi camera module that has a feature that we haven’t seen before - autofocus. We’ll also learn how to use libcamera, the new camera stack that replaces raspistill and raspivid on the latest version of the Raspberry Pi OS (Bullseye).

The Arducam Autofocus Camera is a Raspberry Pi camera module that has a lot of impressive features, especially when you consider that it costs the same as the Raspberry Pi Camera Version 2. It has a 16MP sensor, which is the same resolution as the Raspberry Pi HQ Camera, and it even comes with a case that includes a tripod mount.

And, as the name implies, it also has an autofocus feature - although it does have its limitations, as you’ll see in the video.

We will be using this camera to demonstrate libcamera, the new camera stack included with the latest version of the Raspberry Pi OS. libcamera (the lowercase spelling is intentional) can be used from the command line or called from your Python programs, and it offers complete control over your Raspberry Pi camera module.

We will use libcamera to take still pictures and videos. Not only that, but we’ll also use it to stream video to another workstation, where we can play it back using VLC Media Player.

And, of course, we will compare the picture and video quality of the Arducam Autofocus Camera to some other Raspberry Pi Cameras. It does pretty well for a 25-dollar module!

Here is what you will see in this video:

00:00 - Introduction
01:41 - Camera & Autofocus Methods
05:33 - Look at Autofocus Camera
07:10 - libcamera Introduction
09:31 - Software Installation
12:29 - Pictures with libcamera-still
20:51 - Videos with libcamera-vid
27:34 - Streaming Video with libcamera
31:46 - Camera Quality Tests
39:54 - Conclusion

Now, to be fair, although I really liked the camera there was one big disappointment, at least for me. The camera does not, at least yet, do continuous autofocus. Instead, it performs autofocus when it is first started. However, I will show you a way that you can force it to do an autofocus operation again using the keyboard.

But otherwise, I think this is a great camera, and at such a low cost it’s definitely worth checking out.

Hope you enjoy the video!

"Never trust a computer you can’t throw out a window." — Steve Wozniak