Back to Blog

The Best Way to Merge Videos Programmatically with FFMPEGAPI.net

June 2026 FFMPEG API Team

In today's digital landscape, merging videos programmatically is essential for developers creating rich media applications. Whether you're building a content pipeline or an automation tool, FFMPEGAPI.net offers a powerful, hosted REST API that simplifies video processing without the need for server management. In this article, we'll explore the Picture in Picture endpoint, which allows you to overlay one video on another with ease.

What is the Picture in Picture Endpoint?

The Picture in Picture (PiP) endpoint of FFMPEGAPI.net is designed to create a composition by overlaying one video on top of another. This feature is especially useful for applications like video editing software, live streaming, and more, where you want to display multiple video sources simultaneously.

  • Simple API key authentication
  • No server setup required
  • Customizable overlay options such as position and scale

Using the Picture in Picture Endpoint

To merge videos using the Picture in Picture endpoint, you need to send a POST request with specific parameters. Here’s how to do it:

  • main_video_url: URL of the main video.
  • pip_video_url: URL of the overlay video.
  • position: Where to place the overlay (default is bottom-right).
  • scale: The size of the overlay video (default is iw/4:ih/4).
  • audio_option: Choose the audio source between the two videos (default is video1).
  • async: Option to process the video in the background.
import requests

url = 'https://www.ffmpegapi.net/api/picture_in_picture'
params = {
    'main_video_url': 'https://example.com/main.mp4',
    'pip_video_url': 'https://example.com/overlay.mp4',
    'position': 'top-right',
    'scale': 'iw/4:ih/4',
    'audio_option': 'video1'
}

response = requests.post(url, json=params)
print(response.json())
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", "scale": "iw/4:ih/4", "audio_option": "video1" }'

Merging videos programmatically has never been easier than with FFMPEGAPI.net's Picture in Picture API. By eliminating the need for server setup and providing a robust set of options, this hosted API empowers developers to create sophisticated video compositions seamlessly. Whether you're building a SaaS application or automating your content pipeline, FFMPEGAPI.net is the go-to solution for all your video processing needs.

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free