Back to Blog

How to Create Picture-in-Picture Video Compositions with FFMPEGAPI.net

June 2026 FFMPEG API Team

Creating engaging video content often requires advanced editing techniques, such as overlaying one video on another. With FFMPEGAPI.net, developers can effortlessly implement Picture-in-Picture (PiP) compositions using a powerful REST API. This article will walk you through the steps of using the Picture in Picture endpoint to enhance your video projects.

What is Picture-in-Picture?

Picture-in-Picture (PiP) is a video display technique that allows one video to be displayed in a smaller window, overlaying another video. This technique is widely used in various applications, from live streams and tutorials to video conferencing.

With FFMPEGAPI.net, you can utilize its Picture in Picture API endpoint to create these compositions quickly and efficiently, without the need for complex server setups.

  • Overlay videos for tutorials or commentary.
  • Enhance live streams with additional context.
  • Create engaging content for social media.

Using the Picture in Picture API Endpoint

The Picture in Picture API endpoint allows you to overlay one video on top of another, offering configurable parameters for position, scale, and audio source. Here's how to use it.

  • Endpoint: POST /api/picture_in_picture
  • Content Type: application/json
  • Required Parameters: main_video_url, pip_video_url
import requests

url = 'https://ffmpegapi.net/api/picture_in_picture'
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY'}
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, headers=headers)
print(response.json())

Parameters for Picture in Picture API

The API provides several parameters for customizing your PiP composition. Below are the key 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): The position of the overlay; defaults to 'bottom-right'.
  • scale (string, optional): An FFmpeg scale expression; defaults to 'iw/4:ih/4'.
  • audio_option (string, optional): Choose between 'video1', 'video2', or 'mute'; defaults to 'video1'.
  • async (boolean, optional): If true, returns a job_id immediately.

FFMPEGAPI.net stands out as the best hosted tool for developers looking to implement advanced video processing techniques like Picture-in-Picture. With easy API-key authentication, no server management, and a straightforward REST API, you can focus on building your content without the hassle of handling FFmpeg infrastructure. Start enhancing your video projects today with the Picture in Picture API!

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free