Back to Blog

Creating Picture-in-Picture Videos with FFMPEGAPI.net

June 2026 FFMPEG API Team

In the world of video production, overlays can enhance storytelling and visual engagement. The Picture-in-Picture (PiP) feature allows you to layer one video on top of another, and with FFMPEGAPI.net, you can achieve this effortlessly through a simple REST API. This article explores how to leverage the Picture-in-Picture endpoint to create captivating video compositions.

What is the Picture-in-Picture Feature?

The Picture-in-Picture feature enables you to overlay a secondary video onto a primary video, creating a more immersive viewing experience. This technique is commonly used in tutorials, commentary videos, and live broadcasts.

  • Enhances storytelling by combining visuals.
  • Allows for real-time commentary on gameplay or events.
  • Ideal for creating engaging educational content.

Using the Picture-in-Picture Endpoint

FFMPEGAPI.net offers a straightforward API endpoint to facilitate the creation of PiP videos. The endpoint is designed to be easy to use, eliminating the need for complex server setups or FFmpeg infrastructure management.

  • Endpoint Path: /api/picture_in_picture
  • Method: POST
  • Content Type: application/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"}'
import requests

url = 'https://www.ffmpegapi.net/api/picture_in_picture'
headers = {'Content-Type': 'application/json'}
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 Customization

The Picture-in-Picture endpoint allows various parameters that can be adjusted to suit your needs. Here are some of the key parameters you can use:

  • main_video_url (required): The URL of the main background video.
  • pip_video_url (required): The URL of the overlay video.
  • position (optional): Defines where the overlay will appear (default: bottom-right).
  • scale (optional): Controls the size of the overlay (default: iw/4:ih/4).
  • audio_option (optional): Choose audio source from video1, video2, or mute (default: video1).
  • async (optional): Allows for background processing and immediate job_id response.

FFMPEGAPI.net simplifies the process of video editing and overlaying, making it an ideal choice for developers seeking to integrate video processing capabilities into their applications. By utilizing the Picture-in-Picture endpoint, you can enhance your SaaS applications or content pipelines with minimal effort. Experience the power of hosted video processing today and make your videos more engaging with FFMPEGAPI.net.

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free