Back to Blog

Effortlessly Create Picture-in-Picture Videos with FFMPEGAPI.net

June 2026 FFMPEG API Team

In the world of video production, picture-in-picture (PiP) is a popular technique that allows you to overlay one video on another. This can be particularly useful for tutorials, commentary videos, or any situation where you want to highlight additional content while maintaining the context of the main video. With FFMPEGAPI.net's hosted REST API, developers can effortlessly implement this feature without the hassle of server setup or FFmpeg infrastructure management. Let's dive into how you can create picture-in-picture compositions using our API.

What is the Picture-in-Picture API?

The Picture-in-Picture API endpoint provided by FFMPEGAPI.net allows you to overlay one video on another seamlessly. By using simple API requests, you can define how the overlay video should appear on the main video, including its position, scale, and audio source.

  • No need for complex FFmpeg commands.
  • Quick and easy integration into your projects.
  • Supports a variety of overlay options for customization.

Using the Picture-in-Picture API Endpoint

Our Picture-in-Picture API is accessible via a POST request to the following endpoint:

To create a PiP composition, you need to provide the URLs of both the main and overlay videos, as well as any desired configuration options.

  • Endpoint: POST /api/picture_in_picture
  • Content-Type: application/json
  • Required parameters: main_video_url, pip_video_url
curl -X POST https://www.ffmpegapi.net/api/picture_in_picture \
-H 'Content-Type: application/json' \
-d '{"main_video_url": "https://example.com/main.mp4", "pip_video_url": "https://example.com/overlay.mp4", "position": "top-right"}'
import requests

url = 'https://www.ffmpegapi.net/api/picture_in_picture'

payload = {
    'main_video_url': 'https://example.com/main.mp4',
    'pip_video_url': 'https://example.com/overlay.mp4',
    'position': 'top-right'
}

response = requests.post(url, json=payload)
print(response.json())

Configurable Options for Customization

The Picture-in-Picture API allows you to customize the overlay using several parameters:

You can specify the position of the overlay video (e.g., top-left, bottom-right) and adjust its scale to fit your needs.

  • Position: Choose from top-left, top-right, bottom-left, bottom-right, or center.
  • Scale: Use FFmpeg scale expressions to define the size of the overlay.
  • Audio Option: Select the audio source from the main video, overlay video, or mute.

FFMPEGAPI.net stands out as the best hosted tool for video processing workflows, especially for developers looking for a cloud FFmpeg alternative. Its Picture-in-Picture API simplifies the process of creating dynamic video compositions, allowing for easy integration into applications without the need for extensive server management. Leverage the power of our API today to enhance your video projects with stunning overlays and effects!

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free