Skip to content
On this page

DocsGuides

Picture in picture

Place a second video, scaled down, in a corner of the first.

An overlay can be a video: a camera over a screen recording, a reaction over the clip it reacts to.

The request#

bash
curl "$VIDEXO_API_URL/v1/transcode" \
  -H "Authorization: Bearer $VIDEXO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "https://example.com/screen.mp4",
  "filename": "lesson.mp4",
  "extra_inputs": {
    "camera": "https://example.com/camera.mp4"
  },
  "overlays": [
    {
      "input": "camera",
      "position": "top-right",
      "margin": 32,
      "width": 480
    }
  ],
  "audio": {
    "input": "camera"
  }
}'

lesson.mp4: the screen recording with the camera 480 pixels wide in the top right, 32 pixels in, and the camera’s sound.

audio.input takes the sound from the camera. Without it the output keeps the main video's sound. The output ends with the main video: a longer camera is cut there, and a shorter one holds its last picture (end hides it) while its sound is padded with silence.