Try Pro FREE for 2 weeksGet Started

video-chroma-compose — Traditional AI Model

Chroma Compose keys the green background out of a presenter clip - from VEO, a talking-head or lip-sync model - and lays the person over another video, such as a screen recording of your product. It reads the green itself, cleans the green fringe, softens the cut edges and sizes the face the same way on every take. FFmpeg.

Details

  • CategoryTraditional
  • Year-1
  • License

Inputs & Outputs

BackgroundInputvideo

The video behind the person; sets the output size and frame rate

ForegroundInputvideo

The person on a flat green background

Reference PhotoInputimageoptional

Optional: the photo the foreground was made from. Auto flip reads which way the face turns from it.

VideoOutputvideo

The person composited over the background

Parameters

scale_modestringdefault faceoptions: face, fit, manual

Face sizes the person by their face; Fit fills the width (a 9:16 width on a wider background); Manual uses scale.

'face' (default): measure the face and size/place the cutout by target_face_width_pct and head_top_pct; when no face is found (an animal, a character) the keyed subject is placed instead: its top at head_top_pct, sized to reach the bottom edge (at most the fit size), and a subject too small for that sinks until its last keyed row is on the bottom edge; 'fit' only when nothing is keyed. 'fit': foreground scaled to the portrait width (the background width, or a 9:16 box of its height on a wider background), centred and bottom-aligned. 'manual': fit size times scale, bottom-aligned.

lengthstringdefault foregroundoptions: foreground, background

Which input decides how long the result is.

'foreground' (default): output lasts as long as the foreground (+ preroll); 'background': as long as the background. The shorter input holds its last frame.

audio_sourcestringdefault foregroundoptions: foreground, background, none

Whose audio the result keeps.

'foreground' (default, the presenter's voice), 'background', or 'none'. A missing audio stream gives a silent result.

key_colorstringdefault autoadvanced

Green to remove: auto, or a hex colour like #03A84C.

'auto' (default) reads the median colour of the foreground's first-frame top-left corner. Or give the exact backdrop colour as hex (#RRGGBB).

target_face_width_pctfloatdefault 39.4range 5–100advanced

Face width as a share of the background width, or of a 9:16 width on a wider background (face mode).

Face mode: the face box is scaled to this percent of the portrait width (5-100): the background width, or on a background wider than 9:16 the width of a 9:16 box of its height, so the face fits a square or landscape frame. 39.4 matches a 1080-wide ad with a 426 px face. The scale stays within 0.5-1.0 of the fit size.

head_top_pctfloatdefault 46.9range 0–90advanced

Where the top of the head sits, as a share of the height (face mode).

Face mode: the top of the head is placed at this percent of the background height (0-90).

scalefloatdefault 0.76range 0.1–2advanced

Size in manual mode, relative to fitting the width.

Manual mode: foreground size relative to the fit-width size (0.1-2).

similarityfloatdefault 0.13range 0.01–1advanced

How close to the key colour a pixel must be to be removed.

FFmpeg chromakey similarity (0.01-1). Raise if green remains, lower if the person gets holes.

blendfloatdefault 0.07range 0–1advanced

Softness of the key edge.

FFmpeg chromakey blend (0-1).

despill_mixfloatdefault 0.6range 0–1advanced

How strongly the green fringe on the person is removed.

FFmpeg despill mix (0-1).

feather_pxintegerdefault 50range 0–400advanced

Fade width of the cutout's left and right edges (px).

Fade over this many output pixels at the cutout's left/right edges so a cut-off shoulder does not end in a hard line (0-400).

preroll_framesintegerdefault 0range 0–240advanced

Frames to hold the first foreground frame before it starts.

Holds the first foreground frame for this many output frames and delays the foreground audio by exactly as long (0-240). Pair with Audio Replace sound_offset = preroll_frames / fps.

layout_presetstringdefault staticoptions: static, intro_then_corner, custom

Static keeps one layout; Intro then corner shows the person large, then small at the bottom; Custom follows layout_timeline.

'static' (default): one placement for the whole video (scale_mode etc.) - but a filled layout_timeline is never ignored: with 'static' it is used as 'custom'. 'intro_then_corner': the scale_mode layout for intro_sec, then the presenter eases (transition_sec) to the small corner layout for the rest, so the background (e.g. the product screen) shows; same as layout_timeline '0-<intro_sec>:full, <intro_sec>-end:corner', and layout_timeline is ignored. 'custom': follow layout_timeline (required).

intro_secfloatdefault 2.5range 0–30

How long the person stays large before shrinking (Intro then corner).

layout_preset 'intro_then_corner' only: seconds of output (after preroll) shown with the full layout before the presenter shrinks to the corner layout (0-30). 0 = small from the start.

layout_timelinestringdefault advanced

Layout by time: start-end:mode separated by commas, e.g. 0-2.5:full, 2.5-9:corner, 9-11:off, 11-end:corner.

Comma-separated start-end:mode segments in seconds of output time (after preroll); end may be "end". Modes: 'full' (the scale_mode layout), 'corner' (small, bottom-anchored, see corner_*), 'off' (no presenter: background only; audio unchanged). Must start at 0 and be contiguous - a gap, an overlap or "end" before the last segment fails the run. Boundaries snap to the output frame grid; the last segment runs to the end of the video. Used with layout_preset 'custom', or 'static' when filled; ignored by 'intro_then_corner'. Empty (default) = one static layout.

transition_secfloatdefault 0.3range 0–1advanced

Length of the move between large and small, and of the fade in and out of off.

Seconds (0-1) of each layout change: an ease-in-out of size and position between 'full' and 'corner', and an alpha fade into and out of 'off'. A change starts at its segment's start and is capped at the segment's length. 0 = hard cuts.

corner_positionstringdefault leftoptions: left, center, rightadvanced

Where the small person sits: bottom left, bottom centre or bottom right.

Horizontal anchor of the 'corner' layout. The presenter is aligned, not the green frame around them (measured on the keyed foreground): 'left' (default) puts their left edge at 3% of the width - or on the screen's left edge when the subject is cut off by the foreground's left edge but not its right one (a body leaving the shot, e.g. an animal mirrored by foreground_flip), so the cut does not float at the margin - 'center' centres them, 'right' puts their right edge at the border of the right 12% of the frame (88% of the width) - the right 12% is where platforms draw like/comment icons, so the presenter never sits under them. In every case their right edge never reaches that strip (and a 'right' presenter's left edge never passes 3%) - the cutout shrinks further if it would.

corner_face_width_pctfloatdefault 22range 5–60advanced

Face width of the small person, as a share of the background width, or of a 9:16 width on a wider background.

'corner' layout in face mode: the face box is scaled to this percent of the portrait width - the background width, or a 9:16 box of its height on a wider background - (5-60, default 22; about 35-45% of the frame width for the whole cutout). Face mode with no face found (an animal, a character): the keyed subject is at most corner_face_width_pct / target_face_width_pct of the full layout's size with its last keyed row on the bottom edge (its top goes to corner_head_top_pct only when it is smaller than that). Scale_mode fit/manual, or nothing keyed: the small cutout is 0.42 x the fit width, bottom-aligned.

corner_head_top_pctfloatdefault 62range 0–95advanced

Where the top of the small person's head sits, as a share of the height.

'corner' layout in face mode: the top of the head is placed at this percent of the background height (0-95, default 62). The cutout stays anchored to the bottom edge and may be cut off by it; it is pushed down if it would float above the bottom.

foreground_flipstringdefault offoptions: off, on, auto

Mirror the presenter so they face into the frame.

Mirror the presenter (the keyed foreground) left-right for the whole video; the background is never flipped, and placement (face size, subject alignment, right safe strip) is computed on the mirrored presenter. 'off' (default): as shot. 'on': always mirror. 'auto': when the timeline uses the 'corner' layout with corner_position 'left' or 'right', mirror whenever the face points toward the near edge at all - turned left in a left layout, turned right in a right layout - so the presenter faces the open side (sign only, no frontal dead zone: a near-frontal face mirrored looks the same). The head turn (YuNet landmarks: nose offset from the eye midpoint / eye distance) is read off the Reference Photo input when it is connected and shows a face, so one photo gives the same decision on every run; otherwise it is the median over 5 sampled foreground frames, which can differ between runs of a generated video. With no face in either (an animal, a character) the keyed subject's lean decides: where its head (the top 25% of its keyed rows) sits relative to its whole body, median over 5 frames - an animal in profile or a body leaving the frame on one side faces the side its head is on. Nothing keyed, a turn of exactly 0, corner_position 'center', or a static/full-only layout keep it as shot. Caveat: mirroring also mirrors text and logos on clothing or props and the hair parting, so prefer 'auto' or 'off' for real people wearing printed text.

Tags

  • video
  • chroma key
  • green screen
  • composite
  • overlay
  • ugc
  • ad
  • presenter

Alternatives in Video Editing

  • Audio Edit

    Trim a sound, fit it to a video or a length, dip or mute parts, and fade it.

  • Audio Finish

    Normalize a video's loudness to a broadcast target (2-pass loudnorm + peak limiter).

  • Audio Mix

    Mix narration, music and sound effects into one track, with ducking and loudness.

  • Audio Replace / Mix

    Replace or mix a clip's audio with a new sound, keeping the video as is.

  • Hook Teaser (Cold Open)

    Prepend a cold-open teaser of each clip's hook moment to the front.

  • Ken Burns (Still to Video)

    Animate a still image into a video with a moving crop window.

  • Narration Mux (Cold Open)

    Prepend a voiceover cold-open (frozen first frame + narration) to a clip.

  • Remove Dead Zone

    Remove silent gaps from each clip in a video list to tighten pacing.

All AI models