Embeddings for indexed videos
This guide shows how to retrieve the embeddings that the platform generated when you indexed your videos. This method returns existing embeddings; it does not create new ones.
The platform creates these embeddings with video scene detection, which divides a video into segments at scene boundaries. A scene is a series of frames showing a continuous action or theme. Each segment is between 2 and 10 seconds.
Prerequisites
Your video must be indexed with the Marengo video understanding model. This method supports Marengo 3.0 and older versions. For details on enabling this model for an index, see the Create an index page.
Complete example
Copy and paste the code below, replacing the placeholders surrounded by <> with your values.
Code explanation
Python
Node.js
Retrieve the embeddings
Retrieve the embeddings for an indexed video.
Function call: You call the indexes.indexed_assets.retrieve function.
Parameters:
-
index_id: The unique identifier of the index containing your video. -
indexed_asset_id: The unique identifier of your indexed video. -
embedding_option: The types of embeddings to retrieve. Valid values arevisual,audio, andtranscription. You can specify multiple values. This example uses["visual", "audio", "transcription"].See the Embedding options section for details.
Return value: The response contains, among other information, an object named embedding that contains the embedding data for your video. The embedding.video_embedding.segments field is a list of segment objects. Each segment object includes:
float_: The embedding vector (a list of floats).embedding_option: The type of embedding (visual,audio, ortranscription).embedding_scope: The scope of the embedding (clip).start_offset_sec: The start time of the segment in seconds.end_offset_sec: The end time of the segment in seconds.