Skip to main content
Version: Next

Publish Video - IoT SDK

The Video publishing feature lets an IoT device capture frames from its on-board camera and stream them into a meeting, enabling real-time video alongside audio in your VideoSDK-powered applications.

startPublishVideo()

  • The startPublishVideo() function initiates publishing video captured from your IoT device camera into the active meeting session.
  • This function takes no parameters.
note
  • You must call the init() method before invoking startPublishVideo(). If not, the function returns an INIT_NOT_CALLED result code.

  • Set .videoCodec = VIDEO_CODEC_JPEG in init(). It is the only supported video format.

  • Video can only be published once. Calling this function again while video is already publishing returns a TASK_ALREADY_STARTED result code.

  • Publishing needs a board with a camera; without one it returns DEVICE_NOT_SUPPORTED. See Supported Microcontrollers.

  • There is no separate stop call. leave() tears down all publishing and subscribing when you exit the meeting.

Example

#include "videosdk.h"
#include "esp_log.h"
void app_main(){
result_t publish_video_result = startPublishVideo();
ESP_LOGI("IOT-SDK", "Publish Video Result: %d", publish_video_result);
}

API Reference

The API references for all the methods utilized in this guide are provided below.

Got a Question? Ask us on discord