Create a video embedding task

POST

This method creates a new video embedding task that uploads a video to the platform and creates one or multiple video embeddings.

Ensure your video meets the requirements in the Prerequisites section of the Create video embeddings page.

Upload options:

  • Local file: Use the video_file parameter
  • Publicly accessible URL: Use the video_url parameter.

Specify at least one option. If both are provided, video_url takes precedence.

Notes
  • The “Marengo-retrieval-2.6” video understanding engine generates embeddings for all modalities in the same latent space. This shared space enables any-to-any searches across different types of content.
  • Video embeddings are stored for seven days.
  • The platform supports uploading video files that can play without additional user interaction or custom video players. Ensure your URL points to the raw video file, not a web page containing the video. Links to third-party hosting sites, cloud storage services, or videos requiring extra steps to play are not supported.

Request

This endpoint expects a multipart form containing an optional file.
engine_namestringRequired

The name of the engine you want to use. The following engines are available:

  • Marengo-retrieval-2.6
video_filefileOptional
video_urlstringOptional

Specify this parameter to upload a video from a publicly accessible URL.

video_start_offset_secdoubleOptional

The start offset in seconds from the beginning of the video where processing should begin. Specifying 0 means starting from the beginning of the video.

Default: 0 Min: 0 Max: Duration of the video minus 6

video_end_offset_secdoubleOptional

The end offset in seconds from the beginning of the video where processing should stop.

Ensure the following when you specify this parameter:

  • The end offset does not exceed the total duration of the video file.
  • The end offset is greater than the start offset.
  • You must set both the start and end offsets. Setting only one of these offsets is not permitted, resulting in an error.

Min: video_start_offset + 6 Max: Duration of the video file

video_clip_lengthdoubleOptional

The desired duration in seconds for each clip for which the platform generates an embedding. Ensure that the clip length does not exceed the interval between the start and end offsets.

Default: 6 Min: 2 Max: 10

video_embedding_scopestringOptionalDefaults to clip

Defines the scope of video embedding generation. Valid values are the following:

  • clip: Creates embeddings for each video segment of video_clip_length seconds, from video_start_offset_sec to video_end_offset_sec.
  • clip and video: Creates embeddings for video segments and the entire video.

To create embeddings for segments and the entire video in the same request, include this parameter twice as shown below:

1--form video_embedding_scope=clip \
2--form video_embedding_scope=video

Default: clip

Response

A video embedding task has successfully been created.

_idstringOptional

The unique identifier of the video embedding task. You can use the identifier to:

  • Retrieve the status of your task by invoking the GET method of the /embed/tasks/{task_id}/status endpoint.
  • Retrieve the embedding by invoking the GET method of the /embed/tasks/{task_id} endpoint.

Errors

Built with