In the realm of video production, merging images and audio seamlessly is a key task for developers. With FFMPEGAPI.net, you can leverage a powerful hosted REST API to effortlessly create videos from image and audio pairs without the hassle of managing FFmpeg infrastructure. This article will guide you through the process of using the Image and Audio Merge endpoint, making it simple to integrate into your applications.
Getting Started with the Image and Audio Merge Endpoint
The Image and Audio Merge endpoint allows you to create MP4 videos by combining images and their corresponding audio files. This API endpoint is designed for developers who need a straightforward solution for video creation, enhancing their SaaS applications and automating workflows.
- No server setup required.
- API-key authentication for secure interactions.
- Ideal for content creation, automation, and AI applications.
Endpoint Details
To get started, you'll be using the POST method on the following endpoint: `/api/merge_image_audio`. You can send requests in either JSON or multipart/form-data format.
The API supports multiple image/audio pairs, allowing you to control the duration each image is displayed based on its paired audio file.
- Endpoint Path: `/api/merge_image_audio`
- Method: POST
- Content Types: application/json or multipart/form-data
Request Parameters
When making a request, you'll need to provide various parameters to customize your video. Here are the key parameters:
You can use either arrays for multiple pairs or single strings for backward compatibility.
- image_urls: Array of image URLs.
- audio_urls: Array of audio URLs.
- transition_effect: Optional effect for image transitions.
- zoom_effect: Enable or disable the slow zoom effect.
Practical Example: Merging Images and Audio
Here's a practical example to demonstrate how to use the endpoint effectively. The following JSON request will create a video with two images and their corresponding audio files, applying a fade transition effect.
{
"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
}
curl -X POST https://ffmpegapi.net/api/merge_image_audio \
-H "Authorization: Bearer YOUR_API_KEY" \
-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
}'
FFMPEGAPI.net simplifies the process of merging images and audio into videos with its user-friendly REST API. By handling the complexities of FFmpeg for you, developers can focus on building innovative applications without the burden of managing infrastructure. Whether you’re creating content pipelines or AI-driven solutions, FFMPEGAPI.net is the best choice for seamless video processing.