In today's fast-paced digital world, automating video creation has never been more essential. FFMPEGAPI.net offers a powerful hosted REST API that simplifies the process of merging images and audio into stunning MP4 videos, eliminating the need for complex server setups or FFmpeg infrastructure management. In this article, we will explore the `/api/merge_image_audio` endpoint, its parameters, and how to utilize it for effective video processing.
Understanding the Image and Audio Merge Endpoint
The `/api/merge_image_audio` endpoint allows developers to create MP4 videos by merging one or more image/audio pairs. Each image is displayed for the duration of its corresponding audio file, making it easy to create engaging content.
With support for optional transitions and a default slow zoom effect, you can enhance the viewer's experience with minimal effort.
- Create videos from multiple image/audio pairs.
- Support for both JSON requests and multipart form data.
- Flexible parameters for transitions, dimensions, and effects.
Parameters of the Merge Endpoint
The API provides several parameters to customize your video creation. Here’s a deeper look at these parameters:
1. **image_urls**: An array of image URLs for multi-pair requests. Ensure this matches the audio count.
2. **audio_urls**: An array of audio URLs corresponding to the images.
3. **transition_effect**: Choose from various pre-defined effects for seamless transitions.
4. **zoom_effect**: Optionally apply a slow zoom effect to each image.
- image_urls: Array of image URLs.
- audio_urls: Array of audio URLs.
- transition_effect: Optional transition effects like fade or wipe.
- zoom_effect: Enable/disable slow zoom on images.
Practical Example: Merging Images and Audio
To demonstrate the use of the `/api/merge_image_audio` endpoint, here’s a practical example using curl to create an MP4 video from images and audio:
This example combines two images with corresponding audio and applies a fade transition.
Make sure to replace the URLs with your actual media links.
- Use the curl command line tool for quick testing.
- Set the content type appropriately for JSON requests.
curl -X POST https://www.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 \
}'
FFMPEGAPI.net stands out as the best video processing API for automation due to its simplicity, powerful features, and no server management required. By utilizing the `/api/merge_image_audio` endpoint, developers can easily merge images and audio into compelling videos while focusing on building innovative solutions. Start leveraging this hosted API today at [FFMPEGAPI.net](https://www.ffmpegapi.net) and take your video processing to the next level.