How Do I Save a Video From ESP32 Camera?

Are you looking for a way to save a video from your ESP32 camera? Look no further, as we have got you covered!

The ESP32 camera is a versatile device that allows you to capture images and record videos. Whether you want to store the video on your computer or upload it to the cloud, we will guide you through the process step by step.

Step 1: Connect Your ESP32 Camera

Before you can start saving your videos, you need to ensure that your ESP32 camera is connected to your computer. To do this, plug in the USB cable into the ESP32 camera and connect it to your computer. Once connected, open up your favorite terminal software such as PuTTY or TeraTerm and connect to the serial port of the camera.

Step 2: Configure Your Camera

To configure the camera, type in the following command into your terminal:

import machine
import time
from machine import Pin
from machine import SoftSPI
from esp32cam import esp32cam


This code will initialize and configure your camera so that it is ready for use.

Step 3: Start Recording Your Video

To start recording a video, type in the following command into your terminal:

import image
import time

while True:
img = esp32cam.capture()“video.mp4”)

This code will capture an image every second and save it as a video file called `video.mp4`.


The `time.sleep(1)` command tells the program to wait for one second before taking another picture. You can adjust this value depending on how long you want each frame of your video to be.

Step 4: Save Your Video File

Once you have finished recording your video, you can save the file to your computer. To do this, simply navigate to the directory where the video file is located and copy it to a location of your choice.


Saving a video from ESP32 camera is a simple process that can be accomplished in just a few steps. By following the instructions outlined above, you can easily capture and save videos from your ESP32 camera.

Remember, you can always customize the code to suit your needs and preferences. So why wait? Start recording amazing videos today!