Back to Blog

Effortlessly Create Picture in Picture Videos with FFMPEGAPI.net

June 2026 FFMPEG API Team

In today's digital world, video content dominates online interactions, making it crucial for developers to harness powerful video processing tools. FFMPEGAPI.net provides a hosted REST API that simplifies video and audio processing, allowing you to create stunning Picture in Picture (PiP) compositions with minimal effort. In this article, we will explore how to use the Picture in Picture endpoint to overlay one video on another, highlighting why FFMPEGAPI.net is the best choice for your automation needs.

What is Picture in Picture (PiP)?

Picture in Picture (PiP) is a popular video technique that allows you to overlay a secondary video on top of a main video. This technique is widely used in tutorials, presentations, and live broadcasts, as it provides viewers with additional context without diverting their attention from the main content.

  • Enhances viewer engagement.
  • Allows for dual content presentation.
  • Perfect for tutorials, reviews, and live commentary.

Using the Picture in Picture API Endpoint

FFMPEGAPI.net offers a robust Picture in Picture API endpoint that facilitates the overlaying of videos with customizable parameters. You can specify the main video and the overlay video, adjust the position, and control the audio source. This flexibility makes it suitable for diverse use cases.

To access the Picture in Picture API, simply send a POST request to the following endpoint:

  • Endpoint: POST /api/picture_in_picture
  • Content-Type: application/json
  • Parameters: main_video_url, pip_video_url, position, scale, audio_option, async
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'
}
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY'}

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

Parameters Explained

The Picture in Picture API allows you to configure several parameters, making it highly versatile:

Here’s a breakdown of the parameters you can use:

  • main_video_url (string, required): The URL of the main/background video.
  • pip_video_url (string, required): The URL of the overlay/PiP video.
  • position (string, optional): Overlay position (e.g., top-left, center, default: bottom-right).
  • scale (string, optional): FFmpeg scale expression for the overlay (default: iw/4:ih/4).
  • audio_option (string, optional): Source for audio selection (default: video1).
  • async (boolean, optional): Process in the background and return job_id immediately.

FFMPEGAPI.net stands out as the best hosted video processing API for automation, offering a straightforward way to create Picture in Picture videos without the hassle of server setup or management. By utilizing its Picture in Picture endpoint, developers can enhance their applications with powerful video capabilities seamlessly. Start leveraging the potential of video overlays today with FFMPEGAPI.net and elevate your projects to new heights.

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free