---
title: "How to add a picture in picture with Claude (tested prompt and ffmpeg command)"
description: "A second clip plays in a small white-framed window in the top-right corner. Install one skill and ask Claude Code, or run the ffmpeg command we tested yourself."
url: https://www.recharm.com/effects/picture-in-picture
---

# How to add a picture in picture with Claude

A second clip plays in a small white-framed window in the top-right corner.

Made by the command on this page, from our own test clips.

## Get this effect

1. ### Switch to Code in your [Claude Desktop App](https://claude.com/download)

2. ### Install the skill (once)

   ```
   Install the Recharm video effects skill: download https://recharm-growth-staging.s3.us-east-2.amazonaws.com/website/downloads/recharm-video-effects.zip and unzip it into ~/.claude/skills
   ```

3. ### Ask for the effect

   ```
   Make a picture in picture from main.mp4 and inset.mp4
   Inset width as a share of the main frame: 0.32
   White frame around the inset, in pixels: 6
   ```

## Several videos, several effects, one ask

Put your clips in the folder, mention them with @, and ask for everything at once. Claude runs one tested script after another on each clip, then joins them.

Add a picture in picture to **@clip1.mp4**, put a sale badge on **@clip2.mp4**, give **@clip3.mp4** a VHS look, then join all three with crossfades.

## Settings you can change

Ask Claude to change any of these, or edit them at the top of the command.

| Setting  | Default | What it does                                           |
| -------- | ------- | ------------------------------------------------------ |
| `SIZE`   | `0.32`  | Inset width as a share of the main frame.              |
| `BORDER` | `6`     | White frame around the inset, in pixels. 0 removes it. |
| `MARGIN` | `0.04`  | Gap from the edges, as a share of the frame width.     |

## In other editors

From each editor’s own help pages, in our words. We haven’t run these ourselves.

Built in: **overlay track** · desktop

1. Put the main video on the timeline and place the second video above it.
2. Select the second video and reduce its scale (page's example is 75%).
3. In the Mask feature, choose Circle or Rectangle for the small window's shape.
4. Drag the small video to adjust its position.

Source: [How to Do Picture in Picture on YouTube: A Step-by-Step Guide](https://www.capcut.com/resource/how-to-do-picture-in-picture-on-youtube) (CapCut), checked October 22, 2026.

## Without the skill

Don’t want to install the skill? Paste this prompt into Claude Code and Claude writes the command itself.

```
Put inset.mp4 as a picture-in-picture over main.mp4: scale it to 32% of main's width, give it a 6-pixel white border, and place it in the top-right corner with a gap of 4% of main's width from the top and right edges. Keep main's audio. Use ffmpeg and save it as output.mp4.
```

## Run it without Claude

This is the exact command we tested. Save it as `picture-in-picture.sh` and run:

```
sh picture-in-picture.sh main.mp4 inset.mp4 output.mp4
```

```
#!/bin/sh
# Picture in picture: the second clip plays small in the top-right corner, framed in white.
# Usage: sh picture-in-picture.sh main.mp4 inset.mp4 output.mp4
set -e
MAIN="$1"; INSET="$2"; OUT="$3"
SIZE=0.32    # inset width as a share of the main frame's width
BORDER=6     # white frame around the inset, in pixels
MARGIN=0.04  # gap from the edges, as a share of the main frame's width

W=$(ffprobe -v error -select_streams v:0 -show_entries stream=width -of csv=p=0 "$MAIN")
ffmpeg -y -i "$MAIN" -i "$INSET" -filter_complex "\
[1:v]scale=trunc($W*$SIZE/2)*2:-2,pad=iw+2*$BORDER:ih+2*$BORDER:$BORDER:$BORDER:white[pip];\
[0:v][pip]overlay=x=W-w-W*$MARGIN:y=W*$MARGIN:shortest=1,format=yuv420p[v]" \
  -map "[v]" -map "0:a?" -c:v libx264 -crf 18 -c:a copy "$OUT"
```

## More layouts and reframing

- [Background replacement **Background replacement**](https://www.recharm.com/effects/background-replacement)
- [Binocular view **Binocular view**](https://www.recharm.com/effects/binocular-view)
- [Blur region **Blur region**](https://www.recharm.com/effects/blur-region)
- [Cinematic bars **Cinematic bars**](https://www.recharm.com/effects/cinematic-bars)
- [Comic panel layout **Comic panel layout**](https://www.recharm.com/effects/comic-panel-layout)

## Find 3x _winning ads_

Recharm cuts your ad footage into tagged, searchable clips: hooks, testimonials, product shots. Find the shots that win, add the effect with Claude, and ship 3x more ad edits.

[Start 14-day free trial](https://www.recharm.com/get-started)
