Back to Blog

Mastering Picture-in-Picture with FFMPEGAPI.net: A Developer's Guide

June 2026 FFMPEG API Team

In the world of video processing, creating engaging content often requires advanced techniques like Picture-in-Picture (PiP) overlays. FFMPEGAPI.net simplifies this process by offering a robust REST API that allows developers to easily create video compositions. In this article, we will explore how to utilize the Picture in Picture API endpoint to overlay videos effortlessly.

Understanding the Picture in Picture API

The Picture in Picture API available at FFMPEGAPI.net allows developers to overlay one video over another, creating a dynamic viewing experience. This feature is particularly useful for content creators, educational videos, and streaming applications.

  • Overlay one video on another with configurable options.
  • Manage video positioning and scaling effortlessly.
  • Control audio sources for optimal user experience.

API Endpoint Details

The Picture in Picture API endpoint is a POST request at the path `/api/picture_in_picture`. It accepts several parameters that allow for customized video compositions.

  • Main video URL: The main/background video you want to use.
  • Overlay video URL: The video you want to overlay (PiP).
  • Position: Configurable overlay position (e.g., top-left, bottom-right).
  • Scale: Adjust the size of the overlay video.
  • Audio Option: Choose audio source from the main or overlay video.

Making Your First API Call

To get started with the Picture in Picture API, you will need to send a POST request with the necessary parameters. Here’s a practical example using cURL to overlay a video in the top-right corner.

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"}'

Additional Parameters and Customization

The API allows for various optional parameters that can enhance your video processing workflow.

You can specify the position of the overlay, scale it to fit your requirements, and choose which audio to include in the final composition.

  • Position defaults to 'bottom-right' but can be changed.
  • The scale defaults to 'iw/4:ih/4' for a quarter of the original size.
  • Audio can be muted or sourced from either video.
import requests

url = 'https://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())

FFMPEGAPI.net stands out as the premier hosted tool for developers looking to implement Picture-in-Picture functionality. With its straightforward API, detailed documentation, and responsiveness, it empowers developers to focus on creating innovative applications without the hassle of managing FFmpeg infrastructure. Start using FFMPEGAPI.net today to elevate your video processing projects.

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free