Blend a foreground element into a shot
Place an object or character over the background footage in your editor and export the rough composite as a single video. The API uses that video to blend the element into the shot. It can match the lighting and color, soften hard edges, and add details such as contact shadows and reflections.
Prepare the shot
Set the element’s scale, position, and timing in your editor. If the camera moves, track the element so it stays in place in the scene. Rough edges or mismatched lighting are fine. Fast movement and complex occlusions can still produce artifacts, so review the result around those moments.
Prompt guidelines
A prompt is optional. Use one for complex shots, such as when the element’s mask is damaged or incomplete, objects overlap, or you want more control over how a material looks. In plain sentences, describe the finished shot in this order.
- Identify the element. Say what it is and where it sits in the frame.
- Describe the lighting. Say where each light comes from and what color it is.
- Describe the visual effects you want. Include shadows, reflections, objects passing in front, and any focus or blur. Mention details to preserve, such as a face.
Describe the result you want, for example, “A soft shadow sits under the paws.” If the lighting changes or something passes in front of the element, describe those changes in the order they happen.
Input limits
Use a constant frame rate of 20–60 fps and a clip up to 20 seconds. The long side must be 448–3840 pixels and the short side 256–2176 pixels, in either orientation. The clip must also fit the frame cap for its size.
For other sizes, use the cap for the smallest size in the table with at least as many pixels. For sizes with more pixels than 3840×2160, use the 185-frame cap. Both limits apply. For example, a 3840×2160 clip at 24 fps can be about 7.7 seconds long.
Get the result
The response contains a job id and created_at. Poll the job at GET /v2/video-compositing/{id}. When the job completes, download the video from result.video_url. A ProRes 422 HQ or 4444 input gives a ProRes .mov in the same profile, keeping a 4444 input’s alpha channel. Any other input gives an H.264 MP4.
The output keeps the input’s displayed orientation, frame rate, and frame count. Odd dimensions are padded by one pixel. The output uses the source audio when available. A source with no audio track gives a video with no audio.
Billing is based on the length of the input video. See Pricing.
Authentication
Request
The rough composite as an HTTPS URL, a base64 data URI, or a Cloud Storage storage_uri. See video formats and codecs.
Up to 100 MB from HTTPS or Cloud Storage and up to 15 MB as a data URI.
Response headers
true when an earlier request with the same Idempotency-Key created this job. Not sent otherwise.