Back to Blog

Enhance Your Videos with Picture-in-Picture Using FFMPEGAPI.net

June 2026 FFMPEG API Team

The demand for sophisticated video editing features has never been higher, particularly in SaaS applications and content creation pipelines. One popular effect is the Picture-in-Picture (PiP) overlay, where one video is displayed over another. With FFMPEGAPI.net, integrating video overlays into your applications is easier than ever through our hosted REST API. This article will guide you through the process of using the Picture-in-Picture feature for seamless video composition.

What is Picture-in-Picture?

Picture-in-Picture is a video effect that allows one video to play over another. This technique is widely used in streaming applications, tutorials, and presentations, providing a more engaging user experience.

By using the Picture-in-Picture feature offered by FFMPEGAPI.net, developers can incorporate this capability without the need for complex server setups or FFmpeg management.

  • Overlay videos with custom positions.
  • Control audio sources effortlessly.
  • Quick and simple API access for developers.

Using the Picture-in-Picture API Endpoint

FFMPEGAPI.net provides a dedicated endpoint for creating Picture-in-Picture compositions. The endpoint allows you to overlay one video on another with adjustable parameters.

To start using this feature, you can make a POST request to the following endpoint:

  • Endpoint: `/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'

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())

Parameters for Customization

The Picture-in-Picture feature is highly customizable. Below are the parameters you can use to tailor the effect to your needs:

  • main_video_url: The URL of the main video (required).
  • pip_video_url: The URL of the overlay video (required).
  • position: Control where the overlay appears (default is bottom-right).
  • scale: Adjust the size of the overlay (default is iw/4:ih/4).
  • audio_option: Choose audio source from video1, video2, or mute (default is video1).
  • async: Allows for background processing, returning a job_id immediately.

In today's digital landscape, adding advanced video editing capabilities like Picture-in-Picture can elevate the user experience of your applications. With FFMPEGAPI.net, you gain access to a robust, hosted REST API that simplifies video processing without the hassle of setup and maintenance. Whether you're building SaaS applications, content pipelines, or AI agents, our API key authentication ensures a secure and seamless workflow. Start enhancing your videos today with FFMPEGAPI.net!

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free