VideoAnalysisToolkit
- working_directory (Optional[str], optional): The directory where the video will be downloaded to. If not provided, video will be stored in a temporary directory and will be cleaned up after use. (default: :obj:
None
) - model (Optional[BaseModelBackend], optional): The model to use for visual analysis. (default: :obj:
None
) - use_audio_transcription (bool, optional): Whether to enable audio transcription using OpenAI’s audio models. Requires a valid OpenAI API key. When disabled, video analysis will be based solely on visual content. (default: :obj:
False
) - use_ocr (bool, optional): Whether to enable OCR for extracting text from video frames. (default: :obj:
False
) - frame_interval (float, optional): Interval in seconds between frames to extract from the video. (default: :obj:
4.0
) - output_language (str, optional): The language for output responses. (default: :obj:
"English"
) - cookies_path (Optional[str]): The path to the cookies file for the video service in Netscape format. (default: :obj:
None
) - timeout (Optional[float]): The timeout value for API requests in seconds. If None, no timeout is applied. (default: :obj:
None
)
init
del
_extract_text_from_frame
- frame (Image.Image): PIL image frame to process.
_process_extracted_text
- text (str): Raw extracted OCR text.
_extract_audio_from_video
- video_path (str): The path to the video file.
- output_format (str): The format of the audio file to be saved. (default: :obj:
"mp3"
)
_transcribe_audio
_extract_keyframes
- video_path (str): Path to the video file.
_normalize_frames
- frames (List[Image.Image]): List of frames to normalize.
- target_width (int): Target width for normalized frames.
ask_question_about_video
- video_path (str): The path to the video file. It can be a local file or a URL (such as Youtube website).
- question (str): The question to ask about the video.