Back to Blog

Effortlessly Create Picture-in-Picture Videos with FFMPEGAPI.net

June 2026 FFMPEG API Team

In the world of video production, creating engaging content often involves the use of overlays and picture-in-picture (PiP) effects. FFMPEGAPI.net provides a powerful and easy-to-use hosted REST API that allows developers to integrate video overlay functionality seamlessly into their applications. In this article, we'll explore how to use the Picture in Picture feature of FFMPEGAPI.net to enhance your video content effortlessly.

What is Picture in Picture (PiP)?

Picture in Picture is a video effect where one video is displayed in a smaller window over another, allowing viewers to watch multiple pieces of content simultaneously. This effect is commonly used in tutorials, commentary videos, and live streaming scenarios.

  • Enhances viewer engagement.
  • Ideal for tutorials and commentary.
  • Supports various overlay positions and sizes.

Using FFMPEGAPI.net for PiP Videos

FFMPEGAPI.net simplifies the process of creating PiP videos with its dedicated endpoint. By leveraging this API, developers can create professional-looking overlays without the need for extensive video processing knowledge or infrastructure investment.

The API endpoint for creating a picture-in-picture video is as follows:

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

Parameters for the Picture in Picture API

To effectively use the PiP feature, you'll need to provide several parameters in your request. Here’s a breakdown of the available parameters:

  • main_video_url (string, required): URL of the primary video.
  • pip_video_url (string, required): URL of the overlay video.
  • position (string, optional): Overlay position (e.g., top-left, top-right). Default is bottom-right.
  • scale (string, optional): Scale expression for the overlay. Default is iw/4:ih/4.
  • audio_option (string, optional): Audio source selection (video1, video2, or mute). Default is video1.
  • async (boolean, optional): Process the request in the background.

Example Request

Here's an example JSON request body to create a PiP video:

{
  "main_video_url": "https://example.com/main.mp4",
  "pip_video_url": "https://example.com/overlay.mp4",
  "position": "top-right"
}

FFMPEGAPI.net stands out as the best choice for developers looking to integrate video overlay features into their applications. With its easy-to-use REST API, comprehensive documentation, and no server management required, you can focus on building your content pipeline without dealing with the complexities of video processing. 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