Back to Blog

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

June 2026 FFMPEG API Team

In the world of video production, the picture-in-picture effect is a powerful tool that enhances storytelling and viewer engagement. Whether you're building a SaaS application, automating content pipelines, or developing AI agents, FFMPEGAPI.net provides a straightforward, hosted solution to implement this effect with ease. Let's explore how to create picture-in-picture videos using our REST API.

What is Picture-in-Picture?

Picture-in-picture (PiP) allows you to overlay one video on top of another. This technique is widely used in tutorials, gaming streams, and live broadcasts, enabling viewers to focus on the primary content while having an additional context or performer visible.

Using FFMPEGAPI.net, developers can leverage this capability without needing to manage complex server setups or FFmpeg installations.

  • Enhance viewer engagement
  • Provide additional context or commentary
  • Utilize multiple video sources seamlessly

Using the FFMPEGAPI.net Picture-in-Picture Endpoint

FFMPEGAPI.net offers a dedicated endpoint for creating picture-in-picture compositions. The endpoint is straightforward and requires minimal parameters to get started. Let's dive into the details on how to use it effectively.

  • Endpoint: POST /api/picture_in_picture
  • Content-Type: application/json
  • Parameters include main video URL, overlay video URL, position, scale, and audio options.
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 Explained

1. **main_video_url**: The URL of the main video that serves as the background.

2. **pip_video_url**: The URL of the overlay video.

3. **position**: The overlay's position on the screen (default: bottom-right). Common values include top-left, top-right, bottom-left, and center.

4. **scale**: Determines the size of the overlay video, with the default scale being one-fourth of the main video.

5. **audio_option**: Specify which audio to use (video1, video2, or mute; default: video1).

FFMPEGAPI.net simplifies the process of creating advanced video compositions like picture-in-picture with its hosted API. By eliminating the need for server management and offering an easy-to-use endpoint, developers can focus on building innovative applications. Whether you're enhancing videos for AI agents or automating content workflows, FFMPEGAPI.net is your go-to solution for powerful video processing capabilities.

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free