ESP32 & FPV Camera _Code is not working for live video streaming

#include <opencv2/opencv.hpp>
#include <WiFi.h>

// Replace with your network credentials
const char* ssid = "Shuvra";
const char* password = "Rupabose";

// Analog input pin for video signal
const int videoPin = 36;

// Initialize analog video input
analog_video_input_t videoInput = {
  .pin = videoPin,
  .sync_level = 10,
  .burst_level = 150,
  .white_level = 900,
  .black_level = 300,

// Video capture device
cv::VideoCapture capture;

void setup() {
  // Connect to Wi-Fi network
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.println("Connecting to WiFi...");

  Serial.println("Connected to WiFi");
  Serial.print("IP address: ");

  // Initialize analog video input

  // Initialize video capture device, cv::CAP_V4L2);
  capture.set(cv::CAP_PROP_FRAME_WIDTH, 720);
  capture.set(cv::CAP_PROP_FRAME_HEIGHT, 480);
  capture.set(cv::CAP_PROP_FOURCC, cv::VideoWriter::fourcc('M', 'J', 'P', 'G'));

void loop() {
  // Read and process one frame of video
  analog_video_frame_t frame;
  if (analog_video_read_frame(&videoInput, &frame) == ESP_OK) {
    // Display frame information on the serial monitor
    Serial.print("Frame ");
    Serial.print(", Lines ");
    Serial.print(", Pixels ");

    // Write frame data to the video capture device
    capture.write(cv::Mat(frame.lines, frame.pixels, CV_8UC1,;

  // Display the captured video stream on the screen
  cv::Mat frame;;
  cv::imshow("FPV Camera", frame);

helo there, you have no idea, what you’re doing, right ?
(code wont even compile like this…)

try to describe in words, what the mess above is supposed to do, please.

also, add more info about the hw / sw used.

OpenCV cannot run on ESP32, nor on Arduino.

ESP32 and Arduino also do not have a standard way to make GUIs.