Extract video data

The resources.Video class provides methods to extract data from the videos you’ve uploaded to the platform.

Methods

Extract transcriptions

Description: This method retrieves a transcription of the spoken words.

Function signature and example:

1def transcription(
2 self,
3 index_id: str,
4 id: str,
5 *,
6 start: Optional[float] = None,
7 end: Optional[float] = None,
8 **kwargs
9) -> RootModelList[models.VideoValue]

Parameters:

NameTypeRequiredDescription
index_idstringYesThe unique identifier of the index to which the video has been uploaded.
idstringYesThe unique identifier of the video for which you want to retrieve a transcription.
startOptional[float]NoThe start of the time range (in seconds) for which you want to retrieve a transcription.
endOptional[float]NoThe end of the time range (in seconds) for which you want to retrieve a transcription.
**kwargsdictNoAdditional keyword arguments for the request.

Return value: Returns a RootModelList containing models.VideoValue objects, each representing a segment of the transcription.

API Reference: For a description of each field in the request and response, see the Retrieve a transcription page.

Related guide: Extract transcriptions.

Extract text recognized in video (OCR)

Description: This method retrieves text recognized in video (OCR).

Function signature and example:

1def text_in_video(
2 self,
3 index_id: str,
4 id: str,
5 *,
6 start: Optional[float] = None,
7 end: Optional[float] = None,
8 **kwargs
9) -> RootModelList[models.VideoValue]

Parameters:

NameTypeRequiredDescription
index_ddstringYesThe unique identifier of the index to which the video has been uploaded.
idstringYesThe unique identifier of the video.
startOptional[float]NoThe start of the time range (in seconds) to retrieve OCRs for.
endOptional[float]NoThe end of the time range (in seconds) to retrieve OCRs for.
**kwargsdictNoAdditional keyword arguments for the request.

Return value: Returns a RootModelList containing models.VideoValue objects, each representing a segment of recognized text in the video.

API Reference: For a description of each field in the request and response, see the Retrieve text recognized in video page.

Related guide: Extract text recognized in video (OCR).

Extract logos

Description: This method retrieves information about the logos detected in a specific video.

Function signature and example:

1def logo(
2 self,
3 index_id: str,
4 id: str,
5 *,
6 start: Optional[float] = None,
7 end: Optional[float] = None,
8 **kwargs
9) -> RootModelList[models.VideoValue]

Parameters:

NameTypeRequiredDescription
index_idstringYesThe unique identifier of the index to which the video has been uploaded.
idstringYesThe unique identifier of the video.
startOptional[float]NoThe start of the time range (in seconds) to analyze for logos.
endOptional[float]NoThe end of the time range (in seconds) to analyze for logos.
**kwargsdictNpAdditional keyword arguments for the request.

Return value: Returns a RootModelList containing models.VideoValue objects, each representing a segment where a logo was detected in the video.

API Reference: For a description of each field in the request and response, see the Extract logos page.

Related guide: Extract logos.

Extract thumbnails

Description: This method retrieves a thumbnail of a video. To use this feature, you must enable thumbnail generation for the index to which the video has been uploaded. For details, see the Create indexes page.

Function signature and example:

1def thumbnail(
2 self,
3 index_id: str,
4 id: str,
5 *,
6 time: Optional[float] = None,
7 **kwargs,
8) -> str

Parameters:

NameTypeRequiredDescription
index_idstrYesThe unique identifier of the index to which the video has been uploaded.
idstrYesThe unique identifier of the video.
timeOptional[float]NoThe time in seconds at which to retrieve the thumbnail. If you don’t specify this parameter, the platform retrieves a thumbnail from the middle of the video.
**kwargsdictNoAdditional keyword arguments for the request.

Return value: Returns a str representing the URL of the thumbnail.

API Reference: For a description of each field in the request and response, see the Retrieve a thumbnail page.

Related guide: Retrieve thumbnails.

Built with