Import videos

An import represents the process of uploading and indexing all videos from the specified integration.

This method initiates an asynchronous import and returns two lists:

  • Videos that will be imported.
  • Videos that will not be imported, typically because they do not meet the prerequisites of all enabled video understanding models for your index. Note that the most restrictive prerequisites among the enabled models will apply.

The actual uploading and indexing of videos occur asynchronously after you invoke this method. To monitor the status of each upload after invoking this method, use the Retrieve import status method.

The videos you wish to upload must meet the following requirements:

  • Video resolution: Must be at least 360x360 and must not exceed 3840x2160.
  • Aspect ratio: Must be one of 1:1, 4:3, 4:5, 5:4, 16:9, or 9:16.
  • Video and audio formats: Your video files must be encoded in the video and audio formats listed on the FFmpeg Formats Documentation page. For videos in other formats, contact us at support@twelvelabs.io.
  • Duration: For Marengo, it must be between 4 seconds and 2 hours (7,200s). For Pegasus, it must be between 4 seconds and 60 minutes (3600s). In a future release, the maximum duration for Pegasus will be 2 hours (7,200 seconds).
  • File size: Must not exceed 2 GB. If you require different options, contact us at support@twelvelabs.io.

If both Marengo and Pegasus are enabled for your index, the most restrictive prerequisites will apply.

Notes
  • Before importing videos, you must set up an integration. For details, see the Set up an integration section.
  • By default, the platform checks for duplicate files using hashes within the target index and will not upload the same video to the same index twice. However, the same video can exist in multiple indexes. To bypass duplicate checking entirely and import duplicate videos into the same index, set the value of the incremental_import parameter to false.
  • Only one import job can run at a time. To start a new import, wait for the current job to complete. Use the GET method of the /tasks/transfers/import/{integration-id}/logs endpoint to retrieve a list of your import jobs, including their creation time, completion time, and processing status for each video file.

Path parameters

integration-idstringRequired

The unique identifier of the integration for which you want to import videos. You can retrieve it from the Integrations page.

Headers

x-api-keystringRequired

Request

Request to import videos from a cloud storage bucket to an index.

index_idstringRequired

The unique identifier of the index to which the videos are being uploaded.

incremental_importbooleanOptionalDefaults to true

Specifies whether or not incremental sync is enabled. If set to false, the platform will synchronize all the files in the bucket.

Default: true.

retry_failedbooleanOptionalDefaults to false

Determines whether the platform retries failed uploads. When set to true, the platform attempts to re-upload files that failed during the initial upload process.

Default: false.

user_metadatamap from strings to anyOptional

Metadata that helps you categorize your videos. You can specify a list of keys and values. Keys must be of type string, and values can be of the following types: string, integer, float or boolean.

Notes
  • The metadata you specify when calling this method applies to all videos imported in this request.
  • If you want to store other types of data such as objects or arrays, you must convert your data into string values.
  • You cannot override any of the predefined metadata (example: duration, width, length, etc) associated with a video.

Response

An import has successfully been initiated.

failed_fileslist of objectsOptional

A list of the video files that failed to import. Typically, these files did not meet the upload requirements. To resolve this, review the requirements listed in the Prerequisites section of the Search page.

videoslist of objectsOptional

A list of the videos that will be uploaded and indexed.

Errors