POST /api/analyze-video
Accepts a video clip and a product name. Sends the clip to Gemini for scene analysis, then returns a full scene breakdown, an ad placement recommendation with timestamp and visual instructions, and avideo_id to use in POST /api/generate-ad-video.
Request
Send the request asmultipart/form-data.
The video clip to analyze. Accepted formats: MP4, MOV, MPEG, WEBM, MKV, AVI. Maximum size is
MAX_VIDEO_UPLOAD_MB (default 200 MB).The product to advertise. Typically the
product_name returned by POST /api/identify-product.Response
Detailed scene-by-scene analysis with timestamps and transcript.
Placement recommendation produced by Gemini.
The
product_name value echoed back from the request.UUID identifying the cached video on the server. Pass this to
/api/generate-ad-video. Valid for 30 minutes.Example
Errors
| Status | Cause |
|---|---|
400 | product_name is missing. |
400 | Uploaded file is empty. |
413 | File exceeds MAX_VIDEO_UPLOAD_MB. |
503 | GEMINI_API_KEY is not configured. |
502 | Gemini video analysis request failed. |