In today's digital landscape, the ability to quickly and efficiently merge images and audio into videos is essential for content creators, developers, and automation workflows. FFMPEGAPI.net offers a powerful yet easy-to-use hosted API that allows developers to create MP4 videos from image/audio pairs with minimal setup. In this article, we'll explore the 'Image and Audio Merge' endpoint and show you how to utilize it effectively.
Overview of the Image and Audio Merge API
The Image and Audio Merge API at FFMPEGAPI.net enables you to combine images and audio files to create engaging videos. This feature is particularly useful for applications in content pipelines, where video generation is a frequent requirement.
With this API, you can specify multiple image and audio URLs, control the duration of images being displayed, and apply various transition effects to enhance your videos.
- Create MP4 videos from one or more image/audio pairs.
- Supports both JSON arrays and backward-compatible single URL formats.
- Offers optional image transitions and a zoom effect.
Using the API Endpoint
To utilize the `Image and Audio Merge` functionality, you will send a POST request to the endpoint: `/api/merge_image_audio`. This endpoint accepts various parameters that allow for a tailored video creation process.
Parameters include: image_urls, audio_urls, transition_effect, dimensions, and more. Each parameter helps define how your final video will look and function.
- image_urls: Array of image URLs for multi-pair requests.
- audio_urls: Array of audio URLs length must match image_urls.
- transition_effect: Optional effects such as fade, slideleft, etc.
- zoom_effect: An optional boolean to enable slow zoom on images.
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())
Example Request and Response
Here's a practical example of how to call the merge API. By sending a JSON request with the necessary parameters, you can create a video that showcases both images and audio seamlessly.
The response will provide you with the status of the processing along with the URL to the generated video.
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}'
FFMPEGAPI.net stands out as the best solution for developers looking to integrate media processing capabilities into their applications. With its hosted REST API, there's no need for complex server setups or FFmpeg infrastructure management. Thanks to its straightforward interface and powerful features, the Image and Audio Merge API is perfect for creating rich multimedia experiences efficiently. Start leveraging FFMPEGAPI.net today and streamline your content creation workflows.