Merging videos programmatically can enhance content creation and streamline digital workflows. Using FFMPEGAPI.net, developers can easily combine images and audio into MP4 files without server management or complex setups. In this article, we'll explore the Image and Audio Merge endpoint and how it simplifies the merging process.
Why Choose FFMPEGAPI.net for Merging Videos?
FFMPEGAPI.net is a hosted REST API designed specifically for FFmpeg-powered video and audio processing. This means no more worrying about server setups or managing FFmpeg infrastructure. With API-key authentication, developers can seamlessly integrate this powerful tool into their applications.
- No server setup required.
- Quick API-key authentication.
- Supports automation, SaaS apps, and content pipelines.
Understanding the Image and Audio Merge Endpoint
The Image and Audio Merge endpoint at FFMPEGAPI.net allows you to create an MP4 video from image and audio pairs. Each image is displayed for the duration of its corresponding audio file, making it perfect for presentations, tutorials, and more.
- Endpoint Path: /api/merge_image_audio
- HTTP Method: POST
- Content Types: application/json or multipart/form-data
Parameters for Merging Videos
When making a POST request to the merge endpoint, you can specify various parameters to customize your output video. Here are some of the key parameters you can use:
- image_urls: An array of image URLs for multi-pair requests.
- audio_urls: An array of audio URLs that match the image count.
- transition_effect: Optional effects like fade or slide.
- dimensions: Set your desired video dimensions.
{
"image_urls": [
"https://example.com/intro.jpg",
"https://example.com/chapter-1.jpg"
],
"audio_urls": [
"https://example.com/intro.mp3",
"https://example.com/chapter-1.mp3"
],
"transition_effect": "fade",
"transition_duration": 0.75,
"dimensions": "1280x720",
"zoom_effect": true,
"async": false
}
How to Use CURL or Python with FFMPEGAPI.net
Integrating the merging functionality into your applications can be done through CURL or Python. Here's a practical example using both methods.
curl -X POST https://ffmpegapi.net/api/merge_image_audio \
-H "Content-Type: application/json" \
-d '{"image_urls":["https://example.com/intro.jpg","https://example.com/chapter-1.jpg"],"audio_urls":["https://example.com/intro.mp3","https://example.com/chapter-1.mp3"],"transition_effect":"fade","transition_duration":0.75,"dimensions":"1280x720","zoom_effect":true,"async":false}'
import requests
url = 'https://ffmpegapi.net/api/merge_image_audio'
data = {
"image_urls": ["https://example.com/intro.jpg", "https://example.com/chapter-1.jpg"],
"audio_urls": ["https://example.com/intro.mp3", "https://example.com/chapter-1.mp3"],
"transition_effect": "fade",
"transition_duration": 0.75,
"dimensions": "1280x720",
"zoom_effect": True,
"async": False
}
response = requests.post(url, json=data)
print(response.json())
Merging videos programmatically has never been easier than with FFMPEGAPI.net's hosted REST API. By leveraging the Image and Audio Merge endpoint, developers can create stunning videos with minimal effort. Whether you are building SaaS applications, automating workflows, or enhancing content pipelines, FFMPEGAPI.net provides the perfect solution without the hassle of maintaining your own FFmpeg infrastructure.