Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Yes, an ESP32-CAM can work as a Wi-Fi camera, but the standard setup is video-only. The official Arduino CameraWebServer example serves an MJPEG video stream from the OV2640 camera. The common AI-Thinker ESP32-CAM does not include a standard onboard microphone, so audio requires an external I2S microphone—such as an INMP441—and additional capture code.

The most practical design exposes separate video and audio endpoints. If you need reliable synchronized playback, use a local media gateway such as go2rtc, or choose a more complete RTSP-capable firmware project. The basic Arduino example is a useful maker camera, not automatically a synchronized, authenticated commercial CCTV system.

What the ESP32-CAM can do

Capability Typical ESP32-CAM setup
Browser video Yes, using the official HTTP camera server
Still images Yes
Wi-Fi access Yes, on the local network
Built-in audio on the ordinary AI-Thinker board No
External I2S microphone Yes, with additional wiring and code
Native H.264 or H.265 Not the normal basic workflow; the official example generally serves JPEG/MJPEG
RTSP Requires alternative firmware or a gateway
Secure public deployment Requires separate authentication and network security

The normal data path is:

OV2640 camera → esp_camera frame buffer → JPEG frames → HTTP/MJPEG stream

For audio, the path is separate:

I2S microphone → DMA buffer → PCM samples → WAV or other audio stream

The official Arduino example is maintained in the arduino-esp32 repository. It supports several camera boards, including AI-Thinker, and uses PSRAM-aware settings when available.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Hardware you need

For video

  • AI-Thinker ESP32-CAM or a compatible camera board
  • OV2640 camera module
  • Stable regulated 5V supply
  • USB-to-TTL serial adapter or ESP32-CAM-MB programmer
  • Jumper wires
  • Wi-Fi network
  • Arduino IDE with Espressif ESP32 board support

The AI-Thinker board normally requires an external programming interface; it does not include an onboard debug probe. Its exact pinout matters, so do not apply a pin map from an ESP32-S3, XIAO, or another ESP32-CAM revision.

#1 Best Overall
EC Buying 2Pcs ESP32-CAM Development Board with Automatic Download Type-C Interface Camera Module for IoT and DIY Projects
  • Simplify your IoT and DIY projects with the ESP32-CAM Development Board, featuring an automatic download function and a convenient Type-C interface for seamless programming and easy connectivity
  • Effortlessly connect and control your camera module with this ESP32-CAM Development Board, which includes a Type-C interface for quick and reliable data transfer, perfect for both beginners and advanced users
  • Expand your project's capabilities with the ESP32-CAM Development Board, offering all pins led out for easy connection to external devices, making it ideal for a wide range of IoT and DIY applications
  • Enjoy hassle-free setup with the ESP32-CAM Development Board, designed to automatically download and burn code, eliminating the need for manual resets and simplifying the development process
  • Boost your productivity with the ESP32-CAM Development Board, featuring a built-in CH340 serial port driver for easy USB to 3.3V TTL serial communication, ensuring smooth and efficient project development

For audio

  • 3.3V-compatible I2S MEMS microphone, such as an INMP441
  • Additional jumper wires
  • GPIO pins that are not needed by the camera, flash LED, microSD interface, or boot process

An analog microphone or USB microphone is not a direct replacement for the I2S microphone used by the example architecture.

Step 1: Flash the official video server

  1. Install the Arduino IDE.
  2. Install the Espressif ESP32 board package through Tools > Board > Boards Manager.
  3. Open File > Examples > ESP32 > Camera > CameraWebServer.
  4. Open the example’s board_config.h file.
  5. Comment out unrelated camera definitions and enable the AI-Thinker definition:
#define CAMERA_MODEL_AI_THINKER

Make sure only the camera model matching your physical board is enabled. The official configuration also notes that higher resolutions and high JPEG quality require PSRAM, and the selected partition scheme needs enough application space—at least 3MB for the current example.

  1. In the main sketch, enter your Wi-Fi details:
const char *ssid = "YOUR_WIFI_NAME";
const char *password = "YOUR_WIFI_PASSWORD";
  1. Select the correct ESP32-CAM board profile in Tools > Board.
  2. Select a partition scheme with at least 3MB available for the application.
  3. Connect GPIO0 to GND.
  4. Connect the serial adapter’s TX to the board’s RX and RX to the board’s TX. Connect common GND and suitable power.
  5. Upload at a conservative speed such as 115200 baud. Press the board’s reset button when the uploader begins connecting if necessary.
  6. Remove the GPIO0-to-GND connection and press reset.
  7. Open Tools > Serial Monitor at 115200 baud.

After connecting to Wi-Fi, the sketch prints the camera’s local IP address. Open that address in a browser, for example:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
http://192.168.1.123

The embedded interface normally provides live preview, still-image capture, resolution and JPEG-quality controls, image adjustments, orientation settings, and flash control where supported. The exact controls can change as the Arduino-ESP32 example evolves; its embedded interface is defined in camera_index.h.

Video endpoints and stream format

The official example is an HTTP camera server rather than an ONVIF camera. It generally delivers JPEG frames as an MJPEG stream. That is convenient for browsers and simple software, but it uses more bandwidth than modern H.264 or H.265 video and does not automatically provide audio synchronization.

Some versions and third-party tutorials use port 80 for the control page and port 81 for the stream, with a route such as:

http://CAMERA_IP:81/stream

Do not assume those ports are universal. Use the routes exposed by the firmware you actually flash. A conventional browser page may also hide the stream URL behind its JavaScript controls.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 2: Add an I2S microphone

The microphone is not read through the camera API. The sketch must initialize an I2S receiver, read samples into a DMA buffer, convert them if necessary, and serve them to a client.

For an INMP441-style module, the signal roles are:

Microphone pin Connect to
VDD or VCC 3.3V
GND Common ground
SCK or BCLK Configured I2S bit-clock GPIO
WS, LRCL, or L/RCLK Configured I2S word-select GPIO
SD or DOUT Configured I2S data-input GPIO
L/R Selects the microphone’s left or right channel

One documented AI-Thinker audio implementation uses the following example configuration:

Rank #2
Hosyond 2Pcs ESP32-CAM Wireless WiFi+Bluetooth Development Board with OV Camera Module Compatible with Arduino
  • ESP32CAM is based on ESP32 chip and OV camera module, use low-power dual-core 32-bit CPU, which can be used as an application processor.
  • The main frequency is up to 240MHz, and the computing power is up to 600 DMIPS.
  • Built-in 520 KB SRAM , external 8MB PSRAM ,support UART/SPI/I2C/PWM/ADC/DAC and other interfaces;Support picture wireless upload, TF card, multiple sleep modes, STA/AP/STA+AP working mode, secondary development.
  • It is an ideal solution for IoT applications. The ESP-32CAM comes in a DIP package that plugs directly into the backplane for rapid production.
  • ESP-32CAM can be widely used in various IoT applications. Suitable for home smart devices, industrial wireless control, wireless monitoring, QR wireless identification, wireless positioning system signals, etc.
#define I2S_WS  2
#define I2S_SCK 14
#define I2S_SD  15
#define I2S_PORT I2S_NUM_1
#define SAMPLE_BITS 32

These pins are not universal. Verify the pinout of your board and the exact audio sketch before wiring anything. GPIO2, GPIO14, and GPIO15 can be affected by board functions, boot behavior, or microSD usage. A pin that appears physically accessible may not be electrically convenient for your camera configuration.

The reference video-and-audio implementation is available at ESP32-CAM_Audio. Treat its routes and pin definitions as implementation-specific rather than as an ESP32-CAM standard.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the Arduino audio code must handle

A usable audio server needs more than a microphone declaration. It must configure:

  • I2S receive mode and port
  • Bit clock, word-select, and data GPIOs
  • Sample rate
  • Sample width
  • Mono or stereo channel selection
  • DMA and application buffers
  • WAV headers or another transport format
  • Sample-width conversion when the client expects a different format

A simplified handler looks like this:

void setupI2SMicrophone() {
  // Configure I2S receive mode.
  // Set BCLK, WS/LRCLK, and microphone data GPIOs.
  // Set sample rate, sample width, and channel selection.
}

void streamAudio(WiFiClient& client) {
  sendWavHeader(client, sampleRate, bitsPerSample, channels);

  while (client.connected()) {
    size_t bytesRead = 0;
    i2s_read(
      I2S_PORT,
      audioBuffer,
      sizeof(audioBuffer),
      &bytesRead,
      portMAX_DELAY
    );

    client.write(audioBuffer, bytesRead);
  }
}

This is the structure, not a guaranteed drop-in sketch for every Arduino-ESP32 release. I2S APIs and configuration structures can differ between Arduino-ESP32 and ESP-IDF versions. INMP441 modules commonly produce 24- or 32-bit samples, while many WAV clients expect 16-bit PCM. The implementation may therefore need to shift, truncate, or otherwise convert the samples.

Start with 16kHz mono audio. It reduces memory and bandwidth and makes troubleshooting easier. Confirm that the selected L/R setting matches the channel configured in software. A stream containing bytes but having zero sample amplitude usually indicates a channel, wiring, or sample-format problem.

Step 3: Use video and audio together

Option 1: Separate endpoints

This is the easiest architecture to debug. A documented audio-enabled project uses example routes like:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
http://CAMERA_IP:81/stream
http://CAMERA_IP:82/audio

The exact ports and paths depend on the firmware. Test the video URL and audio URL independently before trying to combine them.

Separate streams are useful for OpenCV, custom JavaScript applications, VLC testing, and media gateways. Their drawback is that the client must handle synchronization.

Option 2: A combined browser page

A custom page can place a video stream and audio stream together, but two independent HTTP connections do not automatically share timestamps. Browser buffering may cause audible delay or drift. A page that displays both elements is not necessarily producing synchronized media.

Rank #3
Freenove ESP32 ESP32-S3 Camera Board Kit (8 MB Flash) with 1GB Card
  • ESP32-S3 camera board: Dual-core 32-bit microprocessor up to 240 MHz, 8 MB flash, 8 MB PSRAM, onboard 2.4 GHz Wi-Fi and Bluetooth 5 (LE), USB-OTG, USB code uploader, camera, memory card slot (Comes with 1GB memory card and card reader)
  • Detailed tutorial: Can be downloaded (in English) or viewed online (original in English, can be translated into other languages by browsers) (The tutorial link can be found on the product box, no paper tutorial)
  • Example projects: Provides step-by-step guide and several typical projects, each project has complete code and detailed explanations
  • 2 sets of code: MicroPython and C. Python is one of the most popular languages, and C is one of the most classic languages
  • Easy to use: Just connect the board to your computer (installed IDE and driver) with the USB cable to program it

Option 3: Use go2rtc

For a more practical home-automation or multi-client setup, let the ESP32-CAM capture the media and let a local computer, NAS, or container run go2rtc. The gateway can repackage streams and present them in formats more compatible with clients and automation systems.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This adds another service to maintain, but it keeps protocol handling, buffering, and client compatibility off the small ESP32. It cannot fix weak power, bad Wi-Fi, incorrect GPIO wiring, or a defective sensor.

VLC, RTSP, and NVR compatibility

The official CameraWebServer output is generally HTTP/MJPEG, not RTSP. VLC, FFmpeg, NVR software, and home-automation platforms may support it, but compatibility depends on the exact URL, container, codec, and audio format.

If you specifically need RTSP, use firmware designed to provide it. For example, esp32cam-rtsp documents URL patterns such as:

rtsp://CAMERA_IP:554/mjpeg/1

That project warns that its default video stream has no password. Another alternative, ESP32-CAM_MJPEG2SD, documents RTSP video and audio options and may impose specific Arduino-ESP32 core requirements. Check the project’s current build instructions before compiling because third-party requirements change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

RTSP support is not the same as guaranteed synchronized audio, authentication, or reliable NVR recording. Validate the exact firmware and client combination you intend to use.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

Upload fails

  • Hold GPIO0 low while uploading.
  • Check that adapter TX goes to board RX and adapter RX goes to board TX.
  • Confirm the board profile and serial port.
  • Use a reliable USB-to-TTL adapter with suitable logic levels.
  • Press reset when the uploader begins connecting.
  • Use a separate, stable power source if the serial adapter cannot supply enough current.

After a successful upload, remove GPIO0 from GND and reset the board.

Brownout messages or random resets

Wi-Fi startup, camera capture, and the flash LED can create current spikes. Weak USB ports, long jumper wires, marginal regulators, and powering the board from a weak 3.3V serial output are common causes.

  • Use regulated 5V power.
  • Keep power leads short.
  • Disable the flash LED while testing.
  • Test camera-only operation before adding the microphone.
  • Reduce resolution and JPEG quality.
  • Add local decoupling if your hardware requires it.

Power quality is a recurring issue in community ESP32-CAM server projects, including the troubleshooting notes in this web-server project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
2PCS ESP32-CAM-MB, Aideepen ESP32-CAM W BT Board ESP32-CAM-MB Micro USB to Serial Port CH-340G with OV2640 2MP Camera Module Dual Mode
  • Package included:2pcs ESP32-CAM-MB Camera Module and 2pcs USB-TTL Serial Adapter Module.Compared with the old model, it does not require complex wiring and supports manual and automatic downloads
  • HK-ESP32-CAM-MB adopts Micro USB interface, convenient and reliable connection method, convenient to apply to various IoT hardware terminal occasions
  • HK-ESP32-CAM-MB module can work independently as the smallest system
  • A new W-BT dual-mode development board based on ESP32 design, using PCB on-board antenna, with 2 high-performance 32-bit LX6CPU, using 7-level pipeline architecture, main frequency adjustment range 80MHz to 240Mhz
  • Ultra-low power consumption, deep sleep current is as low as 6mA. It is an ultra-small 802.11b/g/n W+ BT/BLE SoC module -->>Our technical service team is always ready to answer your questions. please feel free to contact us--)

Camera initialization fails

Check the camera model definition, ribbon-cable orientation, flex-cable insertion, board profile, supply voltage, PSRAM setting, and actual sensor type. AI-Thinker pin definitions will not work on an unrelated camera board.

The stream is slow or freezes

  1. Start at QVGA or VGA.
  2. Increase resolution gradually.
  3. Keep only one client connected while testing.
  4. Disable face detection and unnecessary processing.
  5. Improve Wi-Fi signal strength.
  6. Use a better power supply.
  7. Avoid repeatedly allocating large audio buffers.
  8. Use a proxy or gateway when several viewers are required.

Sensor resolution is not the same as useful streaming performance. PSRAM, frame buffers, JPEG quality, Wi-Fi conditions, and the board revision all affect the result.

Audio is silent

  • Confirm 3.3V and common ground.
  • Check BCLK, WS, and SD individually; they are easy to swap.
  • Verify the microphone’s L/R selection.
  • Confirm that the chosen GPIOs are available on your exact board.
  • Check the I2S port and channel configuration.
  • Try the audio endpoint in VLC or FFplay.
  • Print bytes read and peak sample amplitude in a diagnostic mode.

Audio is noisy

Try shorter wires, a cleaner 3.3V supply, common ground, lower sample rate, mono 16-bit conversion, and the flash LED disabled. Incorrect sample width or channel alignment can sound like severe noise even when the microphone is wired correctly.

The browser refuses to play audio

A browser may reject an indefinite WAV stream, incomplete headers, unsupported sample format, or incorrect content headers. Test with VLC, FFplay, a finite WAV recording, or go2rtc before concluding that the microphone is broken.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Audio and video are out of sync

This is a normal limitation of simple independent HTTP streams. Browser buffers and separate connections do not necessarily have a shared clock. Use a gateway such as go2rtc or a media implementation that adds timestamps and handles both streams together.

Security and privacy

Do not port-forward a hobby ESP32-CAM server directly to the public internet. A local IP address is not authentication, and many HTTP or RTSP projects expose streams without a password.

Prefer local-only access, a VPN, an isolated VLAN, or an authenticated reverse proxy. Do not commit Wi-Fi credentials to a public repository. If the camera records or transmits conversations, check the consent and recording rules that apply in your location.

Which approach should you choose?

Goal Recommended approach
Learn ESP32 camera programming Official video-only CameraWebServer
Experiment with microphone capture External I2S microphone and a dedicated audio-enabled sketch
Build a custom local application Separate MJPEG and audio endpoints
Use home automation or multiple clients ESP32-CAM plus go2rtc or another local gateway
Connect to an NVR RTSP-capable firmware, validated with the specific NVR
Need dependable synchronized audio/video and secure remote access Consider a commercial IP camera or Raspberry Pi-class camera system

The ESP32-CAM is a good choice for a low-cost local monitor, workshop camera, robot, pet camera, or learning project. It becomes a poor fit when reliability, night vision, firmware security, remote access, multi-camera recording, or tightly synchronized audio and video are essential.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For current board definitions and examples, check the Arduino-ESP32 repository. Examples and APIs change, so older tutorials may show different file names, controls, or initialization code.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.