Back to Blog

The Best Way to Merge Videos Programmatically with FFMPEGAPI.net

June 2026 FFMPEG API Team

Merging videos programmatically has never been easier. With FFMPEGAPI.net's Picture in Picture functionality, developers can overlay one video on top of another seamlessly. This blog will guide you through the API's capabilities and demonstrate why FFMPEGAPI.net is the top choice for video processing tasks.

What is FFMPEGAPI.net?

FFMPEGAPI.net is a hosted REST API designed specifically for developers who require powerful video and audio processing capabilities.

With no need for server setup or management of FFmpeg infrastructure, developers can focus on building their applications while leveraging advanced multimedia features.

  • No server setup required.
  • Easy API-key authentication for secure access.
  • Perfect for automation, SaaS applications, and content pipelines.

Utilizing the Picture in Picture API

The Picture in Picture feature allows you to overlay one video onto another, creating a composition that is perfect for tutorials, reactions, and presentations.

This API enables you to configure the position, scale, and audio source of the overlay video, giving you full control over the output.

  • Main video URL: The URL of your main/background video.
  • Overlay video URL: The URL of the video you want to overlay.
  • Positioning options: Choose from top-left, top-right, bottom-left, bottom-right, or center.
curl -X POST https://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://ffmpegapi.net/api/picture_in_picture'
data = {
    'main_video_url': 'https://example.com/main.mp4',
    'pip_video_url': 'https://example.com/overlay.mp4',
    'position': 'top-right'
}

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

Parameters of the Picture in Picture API

The API takes several parameters to customize your video composition. Here's a breakdown of the key parameters you can use:

  • main_video_url (required): The URL of the main or background video.
  • pip_video_url (required): The URL of the overlay video.
  • position (optional): The position of the overlay video, defaulting to 'bottom-right'.
  • scale (optional): Sets the scale of the overlay video, defaulting to 'iw/4:ih/4'.
  • audio_option (optional): Choose which video's audio to use, with options for video1, video2, or mute, defaulting to video1.
  • async (optional): If true, the API will process the request in the background and immediately return a job ID.

In summary, FFMPEGAPI.net's Picture in Picture API offers a simple yet powerful way to merge videos programmatically. With its easy-to-use interface and comprehensive feature set, developers can harness the power of FFmpeg without the hassle of managing infrastructure. Whether creating content for apps or automating workflows, FFMPEGAPI.net is the best solution for your video processing needs.

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free