Video indexing tasks
This method of uploading videos will be deprecated in a future version. New implementations should use direct uploads or multipart uploads followed by separate indexing.
A video indexing task represents a request to upload and index a video. The TaskClientWrapper class provides methods to manage your video indexing tasks.
Methods
Create a video indexing task
Description: This method creates a new video indexing task that uploads and indexes a video.
Your video files must meet requirements based on the models enabled for your index:
- Marengo requirements.
- Pegasus requirements.
- If both models are enabled, the most restrictive limits apply.
Note
This method is rate-limited. For details, see the Rate limits page.
Function signature and example:
Parameters:
Return value: Returns a TasksCreateResponse instance.
The TasksCreateResponse interface contains the following properties:
API Reference: Create a video indexing task.
Retrieve a video indexing task
Description: This method retrieves the details of a specific video indexing task.
Function signature and example:
Parameters:
Return value: Returns a TasksRetrieveResponse object representing the retrieved video indexing task.
The TasksRetrieveResponse class extends VideoIndexingTask and contains the following properties:
The VideoIndexingTaskSystemMetadata class contains the following properties:
The HlsObject class contains the following properties:
API Reference: Retrieve a video indexing task.
Wait for a video indexing task to complete
Description: This method waits until a video indexing task is completed. It checks the task status at regular intervals by retrieving its details. If you provide a callback function, the method calls it after each status check with the current task object. This allows you to monitor the progress of the task.
Function signature and example:
Parameters:
Return value: Returns a TasksRetrieveResponse object representing the completed task. See the Retrieve a video indexing task section above for complete property details.
List video indexing tasks
Description: This method returns a paginated list of the video indexing tasks in your account. By default, the platform returns your video indexing tasks sorted by creation date, with the newest at the top of the list.
Function signature and example:
Parameters:
Return value: Returns a SyncPager[VideoIndexingTask] object that allows you to iterate through the paginated list of video indexing tasks.
The VideoIndexingTask class contains the following properties:
The VideoIndexingTaskSystemMetadata class contains the following properties:
API Reference: List video indexing tasks.
Delete a video indexing task
Description: This method deletes an existing video indexing task. This action cannot be undone. You can only delete video indexing tasks for which the status is ready or failed. If the status of your video indexing task is ready, you must first delete the video vector associated with your video indexing task.
Function signature and example:
Parameters:
Return value: None. This method doesn’t return any data upon successful completion.
API Reference: Delete a video indexing task.
Error codes
This section lists the most common error messages you may encounter while uploading videos.
video_resolution_too_low- The resolution of the video is too low. Please upload a video with resolution between 360x360 and 5184x2160. Current resolution is
{current_resolution}.
- The resolution of the video is too low. Please upload a video with resolution between 360x360 and 5184x2160. Current resolution is
video_resolution_too_high- The resolution of the video is too high. Please upload a video with resolution between 360x360 and 5184x2160. Current resolution is
{current_resolution}.
- The resolution of the video is too high. Please upload a video with resolution between 360x360 and 5184x2160. Current resolution is
video_resolution_invalid_aspect_ratio- The aspect ratio of the video is invalid. Please upload a video with aspect ratio between 1:1 and 2.4:1. Current resolution is
{current_resolution}.
- The aspect ratio of the video is invalid. Please upload a video with aspect ratio between 1:1 and 2.4:1. Current resolution is
video_file_broken- Cannot read video file. Please check the video file is valid and try again.
task_cannot_be_deleted- (Returns raw error message)
usage_limit_exceeded- Not enough free credit. Please register a payment method or contact sales@twelvelabs.io.
video_filesize_too_large- The video is too large. Please use a video with a size less than
{maximum_size}. The current size is{current_file_size}.
- The video is too large. Please use a video with a size less than
video_duration_too_short- The video is too short. Please use a video with duration at least {minimum_duration} seconds. Current duration is {current_duration} seconds.
video_duration_too_long- The video is too long. Please use a video with duration at most {maximum_duration} seconds. Current duration is {current_duration} seconds.
Note that the minimum and maximum durations depend on the models enabled for your index. For details, see the input requirements of each model on the Marengo and Pegasus pages. If both models are enabled, the most restrictive requirements apply.