Video Q&A
The Vision API provides powerful question-answering capabilities for your videos. Once a video has been indexed, you can ask natural language questions about its content and receive AI-powered answers.
Prerequisites
Before using Video Q&A, ensure your video has been successfully indexed:
- Upload a video with
index=true
- Check indexing status - it should be
"indexed"
- Wait for processing if status is
"indexing"
Ask Questions
Use the /qa/chat
endpoint to ask questions about your videos:
Request Parameters
video_id
(optional): ID of the video to analyzevideo_url
(optional): URL of the video to analyze (eithervideo_id
orvideo_url
is required)messages
(optional): List of chat messages
Using Chat Messages
For multi-turn conversations, use the messages
parameter:
Using Video URL
You can also provide a video URL instead of a video ID:
Streaming Responses
For real-time responses, use the /qa/stream
endpoint:
This returns a Server-Sent Events (SSE) stream with real-time updates.
Response Format
Chat Response
Stream Response
Question Examples
Here are some example questions you can ask:
- General: “What is happening in this video?”
- Specific: “What color is the car in the video?”
- Temporal: “What happens at the beginning of the video?”
- Analytical: “How many people are in the scene?”
- Descriptive: “Describe the setting and atmosphere”
Best Practices
- Be specific in your questions for better answers
- Check indexing status before asking questions
- Use streaming for long videos or complex questions
- Provide either video_id or video_url, not both
Error Handling
- Video not found: Ensure the video_id is correct
- Video not indexed: Wait for indexing to complete
- Indexing failed: Re-upload the video with
index=true
- Invalid request: Ensure only one of
video_id
orvideo_url
is provided