How to replace a video background

Replacing a video background is a two-step process: remove the original background to produce a matte (a mask that separates the subject from everything behind it), then composite a new background behind the subject. The removal method you choose determines the edge quality, the time it takes, and whether you need a green screen.

Green screen key

Cleanest edges, fastest key. Requires footage shot against a solid green (or blue) backdrop. Best when you control the shoot.

AI removal

No green screen needed. Software segments the subject automatically. Works on any footage. Edges may be rough on hair and motion blur.

Manual mask + track

Frame-by-frame rotoscoping. Most precise, most labour-intensive. Use when neither green screen nor AI produces a usable matte.

Already have green screen footage? Key it first using the green screen removal settings, then composite your new background. No green screen? Start with AI background removal and refine from there.


The difference between removing a video background and replacing it is simple but easy to confuse. Removal is the separation step: the software identifies which pixels belong to the subject and which belong to the background, then discards or makes transparent the background pixels. Replacement takes that separated subject and places it over a new background. You can remove without replacing, producing a transparent video for use on a web page or in a compositor. You cannot replace without first removing, because the new background has to go somewhere, and that somewhere is where the old background was.

This page covers the full replacement workflow: choosing the removal method, performing the removal, compositing the new background, fixing the common problems that make composites look fake, and exporting the result. If you only need to remove the background without replacing it, see the three removal methods compared. If you are working with a green screen and want to replace it with a static image specifically, the image replacement guide covers Photoshop, GIMP, and ffmpeg approaches in more detail.

The three replacement paths at a glance

Path Requires Edge quality Time per clip
Green screen key Green screen footage Best (deterministic matte) Minutes
AI background removal Any footage Good (struggles with hair, blur) Minutes to hours
Manual mask + track Any footage Best (frame-level control) Hours to days

The green screen path is fastest and produces the cleanest edges because the background colour is known and uniform, making the matte boundary deterministic. The AI path is the most accessible because it works on any footage, but the model infers the boundary rather than measuring it, which produces rougher edges on fine detail like hair and semi-transparent objects. The manual path is the most precise but requires drawing or adjusting a mask on every frame, which is impractical for clips longer than a few seconds.

Path 1: Green screen key and composite

If your footage was shot against a green screen, the replacement path is the most straightforward. The green background provides a known colour that the keyer can isolate and remove, producing a clean matte. You then place your new background on a layer below the keyed subject.

Step 1: Key the green. In your editor, apply the chroma key tool to the footage. Adjust the key colour to match your specific green (not all green screens are the same shade), then set the tolerance or threshold to remove the full background without eating into the subject. The keying settings guide covers the specific parameters for spill suppression, edge choke, and matte refinement.

Step 2: Suppress spill. Green light bounces from the screen onto the subject, especially on hair and reflective surfaces. Apply a despill filter to shift the green-tinted pixels toward a neutral colour. Most keyers include a spill suppression control; if yours does not, a secondary colour correction targeting green in the subject's highlights works as a manual fix.

Step 3: Place the new background. Import the replacement background (an image, another video, or a generated graphic) and place it on the timeline layer below the keyed subject. Scale and position the background to fill the frame. If the replacement is a video, align its duration and timing with the subject clip.

Step 4: Refine the edge. The boundary between the subject and the new background is where composites fail. Apply a slight feather (1 to 3 pixels) to the matte edge to avoid a hard, cut-out look. If the subject was shot with motion blur, the matte edge should be softer in the direction of motion. Use a garbage matte to remove any large areas of unkeyed green at the frame edges.

Step 5: Match and export. Match the lighting direction, colour temperature, and depth of field between the subject and the new background (covered in detail below). Export as MP4 (H.264 or H.265) with the composite baked in, since the replacement is final.

FFmpeg can perform the entire key and composite from the command line without opening an editor. The chroma key filter replaces the green with a new background image in a single pass: ffmpeg -i subject.mp4 -i background.jpg -filter_complex "[0:v]chromakey=0x00FF00:0.3:0.1[keyed];[1:v][keyed]overlay" -c:v libx264 output.mp4. The 0.3 is the similarity tolerance and 0.1 is the blend margin. Adjust both for your specific green screen shade and lighting.

Editor-specific steps for the green screen path

DaVinci Resolve (free). Open the Color page. Select the clip node, right-click, and add a Delta Keyer from the OpenFX library. Pick the green screen colour with the eyedropper in the qualifier panel. Adjust the low and high softness sliders until the background is fully transparent in the alpha channel view (toggle the alpha viewer icon at the bottom right of the viewer). If the key eats into the subject, pull the high threshold down. If green spill remains on the subject, add a Spill Suppression node after the keyer and dial down the green channel in the suppress tab. To composite: place the background image on track V1 and the keyed subject on track V2 above it. The alpha from the Delta Keyer automatically punches through to the layer below.

Adobe Premiere Pro. Drag the Ultra Key effect onto the subject clip in the timeline. Use the eyedropper next to the Key Colour setting to sample the green. Set the Setting preset to Aggressive first, then dial back to Relaxed if the subject edge is being eaten. Adjust Matte Cleanup: increase Pedestal to remove grey semi-transparent pixels in the background, increase Suppress to remove spill on the subject. Place the background on the track below the subject clip. The composite renders in the program monitor in real time.

CapCut (desktop). Import both the green screen clip and the background. Drag the green screen clip to the timeline, right-click it, and select Remove Background. CapCut auto-detects the green and applies the key. If the result has a fringe, open the Cutout settings and increase the edge feather. Drag the background clip to a track below the subject. Position and scale it to fill the frame. Export to MP4 H.264.

If the green screen key fails. The most common cause is uneven lighting on the green screen itself. If parts of the screen are darker green (corners, folds, shadows), the keyer cannot remove them all with one threshold. Three alternatives: (1) Draw a garbage matte around the subject to exclude the worst-lit edges of the screen, then key only the evenly lit area. (2) Key the footage twice: once with a tight threshold for the well-lit centre, once with a loose threshold for the edges, and combine the two mattes with an additive merge. (3) If the green screen is beyond rescue, switch to the AI removal path (Path 2) or the manual masking path (Path 3) for the problematic sections.

Path 2: AI background removal and composite

If you do not have green screen footage, AI background removal is the fastest path to a usable matte. The software analyses each frame, identifies the subject, and produces a mask that separates the subject from the background. The quality of the mask depends on the model, the footage, and how much refinement you are willing to do.

DaVinci Resolve (Magic Mask). Draw a stroke on the subject in the viewer; the Magic Mask tool tracks the subject across frames and produces a matte. The free version includes this tool. For complex scenes with multiple subjects or fast motion, you may need to draw multiple strokes and let the tool track each region separately. The matte can be refined with softness and edge adjustment controls.

Adobe After Effects (Roto Brush). Paint over the subject on one frame; Roto Brush propagates the selection across subsequent frames. The propagation is not perfect and requires correction on frames where the subject boundary changes sharply (a person turning, a hand raising). After Effects also includes the Refine Edge tool, which uses a soft brush to capture semi-transparent areas like hair.

CapCut (Background Removal). The desktop and mobile versions include a one-click background removal feature that works for simple scenes. The mask quality is lower than Resolve or After Effects but is sufficient for talking-head videos and social media clips. CapCut also includes replacement backgrounds (blur, colour, image) that can be applied directly.

RunwayML and browser-based tools. Cloud-based AI tools can remove backgrounds from uploaded video. The model handles the segmentation; you download the result or composite directly in the tool. These tools are convenient but involve uploading your footage to a server, unlike the local browser-based approach used for images on this site. If privacy is a concern, use a local tool instead.

Once the AI matte is produced, the compositing step is the same as the green screen path: place the new background on the layer below, refine the edge, match lighting and colour, and export. The difference is that the AI matte may need more edge work, particularly on hair, semi-transparent fabrics, and motion-blurred frames.

Editor-specific steps for the AI path

DaVinci Resolve Magic Mask (step by step). On the Color page, open the Magic Mask panel (Window menu, or the wand icon). Select Foreground mode. Draw a stroke on the subject by clicking and dragging across their torso or face. The tool analyses the frame and creates a mask. Click Track Forward (the right-pointing arrow) to propagate the mask across subsequent frames. For fast-moving subjects, stop the track every 10 to 20 frames and draw a correction stroke on any area where the mask has drifted. Adjust the Softness slider (typically 2 to 4) to feather the edge. To composite: go to the Deliver page, but first place the background on track V1 in the Edit page and the subject clip with the Magic Mask on V2. The mask punches through automatically.

Adobe After Effects Roto Brush (step by step). Double-click the subject clip to open it in the Layer panel. Select the Roto Brush tool (keyboard shortcut: Alt+B on Windows, Option+B on Mac). Paint over the subject on the first frame with a green stroke. The tool segments the subject and displays the mask in pink. Move one frame forward (Page Down key) and check the propagation. If the mask has shrunk or drifted, paint a correction stroke on the missed area. Continue through the clip, correcting every 5 to 15 frames. The Roto Brush span (the green bar at the bottom) shows how far the propagation has gone. Once the full clip is covered, open the Refine Edge tool (under the Roto Brush dropdown) and paint along hair edges and semi-transparent areas. The tool creates a soft edge that captures individual strands. To composite: place the background layer below the subject layer in the composition. The Roto Brush mask is applied automatically.

CapCut Background Removal (step by step). Import the subject clip and drag it to the timeline. Right-click the clip and select Cutout, then Remove Background. CapCut processes the clip and produces a matte. For talking-head videos, the result is usually clean. For complex scenes (multiple people, fast motion), the mask may flicker. To fix: split the clip at the flicker points and re-run Remove Background on each segment. To composite: drag the background image to a track below the subject. Scale and position as needed.

If AI removal fails. AI models struggle with three scenarios: fine hair against a similar-coloured background, fast motion that blurs the subject boundary, and semi-transparent objects (glass, sheer fabric). If the matte flickers or tears on these areas, three alternatives: (1) Combine AI with manual masking: use AI for the body and switch to a manual mask for the hair region only. (2) Render the AI matte at a lower resolution first (proxy at 540p), then manually correct the edge at full resolution only on the problem frames. (3) If the footage has a consistent background (not green screen but a plain wall), try the green screen keyer anyway with the wall colour as the key colour, it may produce a cleaner edge than AI on some footage.

Path 3: Manual masking and tracking

When neither a green screen nor AI produces a usable matte, the fallback is manual rotoscoping: drawing a mask around the subject frame by frame, or drawing it on keyframes and letting the editor interpolate (track) the mask between them. This is the most time-consuming method but gives frame-level control over the matte boundary.

Step 1: Draw the mask on a keyframe. Choose a frame where the subject is clearly separated from the background and draw a mask (bezier shape) around the subject's silhouette. Keep the mask slightly inside the subject boundary rather than on the exact edge, to avoid capturing background pixels.

Step 2: Track the mask. Use the editor's mask tracking tool to propagate the mask across frames. Most editors (After Effects, Resolve, Premiere Pro) can track masks using motion analysis. The track will drift on frames with fast motion, occlusion (the subject crosses behind an object), or when the subject's silhouette changes shape dramatically. Correct these frames manually.

Step 3: Feather the edge. Apply a feather of 2 to 5 pixels to avoid a hard cut-out look. The exact amount depends on the resolution: at 1080p, 2 to 3 pixels is usually enough; at 4K, you may need 4 to 6 pixels for the same visual softness.

Step 4: Composite and export. Place the new background below the masked subject layer, match lighting and colour, and export. The compositing and export steps are identical to the other two paths.

For a deeper comparison of the three removal methods (without the compositing step), see the video background remover guide. That page covers AI vs manual vs green screen in terms of cost, quality, and tool selection.

Editor-specific steps for the manual path

After Effects (mask tracking). Select the Pen tool (keyboard shortcut: G). Draw a closed bezier shape around the subject on the first frame. In the Timeline, expand the mask properties: Mask Path, Mask Feather, Mask Opacity. Set Mask Feather to 2 to 3 pixels. Click the stopwatch next to Mask Path on the first frame, then move forward frame by frame (Page Down). On each frame where the subject has moved, adjust the mask control points to follow the silhouette. After Effects can interpolate between keyframes: set a keyframe every 5 to 10 frames and let the interpolation fill the gaps. For complex motion (a person walking, turning), set keyframes every 2 to 3 frames. To composite: place the background layer below the subject layer. The mask is applied automatically to reveal only the subject.

DaVinci Resolve (Power Window tracking). On the Color page, add a Power Window (Window menu, choose Linear or Curve). Draw the window around the subject. In the Tracker panel, select Track Forward to track the window across frames. The tracker follows the window position and rotation. For subjects that change shape (a person sitting down), you need to adjust the window shape on keyframes: stop the track at the shape-change point, redraw the window, and continue tracking. Add a softness of 2 to 5 in the Window parameters. To composite: use an Alpha Output in the node tree. Connect the Power Window node to an alpha output, then place the background on a lower track in the Edit page.

If manual tracking fails. Mask tracking drifts when the subject crosses behind an object (occlusion), when the background has a similar colour to the subject, or when the motion is too fast for the tracker to analyse. Three alternatives: (1) Break the clip into segments at the occlusion point and track each segment separately with a fresh mask. (2) Use a combination of point tracking and mask tracking: track a point on the subject (a button, a shoulder) and link the mask position to that point, so the mask follows the point even when the shape-based tracker loses the subject. (3) If the clip is too complex for any automated tracking, draw the mask manually on every frame. This is feasible for clips under 5 seconds at 24 fps (120 frames) but impractical for longer clips.

Making the composite look real

A replaced video background looks fake when the viewer's eye detects a mismatch between the subject and the new background. The four most common mismatches are edge artifacts, lighting direction, colour temperature, and depth of field. Each has a specific fix.

Edge artifacts (fringe, halo, jitter). A green or light-coloured fringe around the subject means the key or mask did not fully remove the background colour. Fix with a slight edge choke (shrinking the matte inward by 1 to 2 pixels) or a desaturate filter on the matte edge. A dark halo means the matte is too tight and is eating into the subject; expand it slightly. Edge jitter (the matte boundary wobbling frame to frame) comes from noise in the key or mask tracking; apply a temporal smoothing filter to stabilise the edge across frames.

Lighting direction. If the subject is lit from the left but the replacement background has light coming from the right, the mismatch is immediately visible. Match the direction by either choosing a background with compatible lighting, flipping the background horizontally, or adding a subtle directional light on the subject in post (a brightness gradient or a soft spotlight effect from the correct side).

Colour temperature. The subject and background should share the same white balance. If the subject was shot under tungsten light (warm, around 3200K) and the background is daylight (cool, around 5600K), apply a colour correction to one of them to bring them into the same temperature range. The fastest check: look at the whites in the scene (teeth, eyes, a white shirt) and compare them to the whites in the background.

Depth of field. In real photography, the background is slightly out of focus relative to the subject. If both the subject and the replacement background are in perfect focus, the composite looks like a collage. Apply a slight blur (Gaussian, radius 2 to 8 pixels depending on resolution and intended distance) to the background layer. The farther the background is supposed to be from the camera, the more blur it should have. For a deeper guide on background blur specifically, see the blur background video guide.

Compositing with a transparent video as an intermediate

Instead of baking the replacement into the final export, you can export the subject as a transparent video (WebM with alpha or MOV with ProRes 4444) and composite the background later, either in another editor or directly on a web page. This is useful when the background needs to be dynamic (a different image per page load, a live video feed, or an interactive element).

The export format must support alpha: WebM with VP8 or VP9 for web delivery, MOV with ProRes 4444 for post-production handoff, or PNG image sequences for maximum compatibility. Standard MP4 (H.264) does not carry alpha and will produce a solid black background. The transparent background video guide covers the export settings for each format in detail.

For web compositing, embed the transparent video with the HTML5 <video> element and place the background (image, CSS gradient, or another video) behind it using CSS positioning. The browser renders the alpha channel natively in Chromium and Firefox.

Export settings for the final composite

Once the new background is composited behind the subject and the result looks correct, export the final video. Because the replacement is baked in, you do not need an alpha-capable format. The standard delivery format is MP4 with H.264 encoding, which plays on every device and platform.

Setting Recommended value Notes
Container MP4 Universal playback support
Video codec H.264 H.265 for smaller files if the target platform supports it
Bitrate 8 to 12 Mbps (1080p) Higher for fast-motion content; lower for talking heads
Resolution Match source (1920x1080 or 3840x2160) Scale down, not up
Frame rate Match source (24, 30, or 60) Do not convert frame rates; it introduces judder
Audio AAC, 192 kbps Include if the subject is speaking; omit for silent overlays

If you exported the subject as a transparent intermediate and composited on a web page instead of in an editor, the export step does not apply. The transparent video is served as-is, and the background is rendered by the browser.

Verifying the exported file

After exporting, verify the file before publishing or delivering it. Four checks take less than two minutes and catch the most common problems.

Check 1: File size and duration. Open the exported file in a media player (any player that displays file properties). The duration should match the source clip to the second. The file size should be reasonable for the bitrate: at 10 Mbps and 1080p, a 60-second clip should be roughly 75 MB. A file that is dramatically smaller (under 10 MB for 60 seconds at 1080p) likely has a bitrate that is too low and will show compression artefacts. A file that is dramatically larger may have an unnecessarily high bitrate.

Check 2: Edge quality on a high-contrast background. Play the video against a bright solid colour (magenta or pure blue) that is unlikely to appear in either the subject or the replacement background. If you see a fringe (a coloured outline around the subject), the key or mask edge needs more work. If you see halos (dark outlines), the matte is too tight. If the edge jitters frame to frame, apply temporal smoothing and re-export.

Check 3: Transparent regions (if exporting with alpha). If you exported as WebM with alpha or ProRes 4444, open the file in a player that supports alpha (Chrome for WebM, QuickTime for ProRes 4444). Place a coloured background behind the video element. If the background shows through correctly, the alpha is working. If you see a solid black background instead of the coloured background, the file does not carry alpha, you likely exported as H.264 by mistake or the alpha flag was not set in the encoder.

Check 4: Frame-by-frame spot check. Scrub through the video at 25%, 50%, 75%, and 100% of the duration. Pause on each and look at the subject edge, the background alignment, and any areas where the subject moves quickly. This catches flicker, mask drift, and missing frames that are not visible at full speed. If you find a problem on one frame, note the timestamp, go back to the editor, fix that section, and re-export only the affected range if your editor supports in-and-out point export.

Replacing a single frame vs a video clip

If you only need to replace the background of a single image rather than a video clip, the workflow is simpler: remove the background (using a browser-based tool, Photoshop, or GIMP), then composite the new background in any image editor that supports layers. The image replacement guide covers this in detail, including the Photoshop Color Range and Blend If methods, GIMP's Color to Alpha, and the browser-based approach that processes the image locally without uploading.

For a video clip, the removal step must run on every frame, which is why green screen keying (fast and automatic) and AI removal (automatic but slower) are preferred over manual masking (which must be drawn or tracked per frame). A single-frame tool cannot replace a video background because it does not handle temporal consistency: the mask must be coherent across frames, not just correct on each frame independently.

Quick answers

What is the difference between removing a video background and replacing it?

Removing the background means separating the subject from the original background and producing a matte or transparency. Replacing the background means taking that matte and compositing a new background behind the subject. Removal is the first step; replacement is the full workflow. You can remove without replacing (exporting a transparent video), but you cannot replace without first removing.

Do I need a green screen to replace a video background?

No. A green screen makes the removal step easier and more reliable because the background colour is known and uniform. Without a green screen, you can use AI background removal (which segments the subject automatically) or manual masking and rotoscoping (which is labour-intensive but precise). The green screen path produces the cleanest edges; the AI path is faster but may struggle with hair, motion blur, and low-contrast subjects.

Can I replace a video background for free?

Yes. DaVinci Resolve (free version) includes a Delta Keyer for green screen footage and a Magic Mask tool for AI-based removal without a green screen. CapCut offers background removal on desktop and mobile at no cost. FFmpeg can perform chroma key compositing from the command line at no cost. Browser-based tools can remove backgrounds from single frames locally without uploading. Paid tools like Adobe Premiere Pro, After Effects, and RunwayML offer more refined AI models and tracking, but are not required for basic background replacement.

What format should I export after replacing the video background?

If the new background is already composited behind the subject, export as MP4 (H.264 or H.265) for general delivery. The replacement is baked in, so no alpha channel is needed. If you need to keep the replacement live (the background is a separate layer that can be swapped later), export as a transparent video format such as WebM with alpha or MOV with ProRes 4444, then composite in the editor or on the web page.

Why does my replaced video background look fake?

The most common causes are edge artifacts (fringe, halo, or jagged matte boundaries from a poor key or mask), mismatched lighting (the subject is lit from one direction but the replacement background has light from another), mismatched colour temperature (warm subject on cool background or vice versa), and missing depth of field (the subject and background are both in sharp focus, which does not happen in real photography). Fix the edge first, then match lighting direction, colour temperature, and apply a slight blur to the background to simulate camera depth.


Related reading: removing a green screen from video (the keying settings that produce the matte), removing a video background without a green screen (AI and manual methods compared), replacing a green screen with a static image (Photoshop, GIMP, and ffmpeg approaches), exporting a transparent video (alpha formats and export settings), and blurring a video background (simulating depth of field in post).