Back to Blog

Effortless Picture-in-Picture Video Processing with FFMPEGAPI.net

June 2026 FFMPEG API Team

In today's digital landscape, incorporating sophisticated video editing capabilities into applications is essential. The picture-in-picture (PiP) effect is a popular feature that allows users to watch one video while simultaneously viewing another. FFMPEGAPI.net provides a hosted REST API that simplifies the process of creating these compositions without the hassle of server management. This article will guide you through using the Picture in Picture endpoint effectively.

Understanding the Picture-in-Picture Feature

Picture-in-picture (PiP) allows users to overlay one video on top of another, enhancing the viewing experience. This feature is particularly useful for applications such as streaming services, video conferencing tools, and educational platforms where multitasking is essential.

With FFMPEGAPI.net, developers can leverage this powerful video processing capability without worrying about the underlying infrastructure.

  • Overlay videos in various positions.
  • Control scale and audio options for the overlay.
  • Easy integration with existing applications via a simple API.

Using the Picture in Picture API Endpoint

FFMPEGAPI.net offers a dedicated endpoint for creating picture-in-picture compositions. The endpoint is accessible via a POST request to /api/picture_in_picture, providing a simple interface for developers to use.

The following parameters are required to successfully create a PiP video:

  • main_video_url: The URL of the main video.
  • pip_video_url: The URL of the overlay video.
  • position: (optional) Specifies where to place the PiP video (default: bottom-right).
  • scale: (optional) Defines the size of the overlay video (default: iw/4:ih/4).
  • audio_option: (optional) Selects which video's audio to use (default: video1).
  • async: (optional) Enables asynchronous processing.
import requests

url = 'https://www.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"
}

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

Practical Example of Picture-in-Picture Creation

Here is a practical example of how to use the Picture in Picture API to overlay one video on another. In this example, we will place an overlay video at the top-right corner of the main video.

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

Incorporating picture-in-picture functionality into your applications doesn't need to be a complex endeavor. With FFMPEGAPI.net, developers can easily create professional-quality video compositions through a simple API call, eliminating the need for server management. Embrace the power of programmatic video editing and elevate your application's user experience while saving time and resources with FFMPEGAPI.net.

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free