In the world of multimedia applications, automating video creation is a crucial task, especially for developers working with AI agents. FFMPEGAPI.net offers a robust solution for merging images and audio through its hosted REST API. This article will explore the capabilities of the /api/merge_image_audio endpoint, providing you with practical examples to streamline your video production workflows.
Understanding the /api/merge_image_audio Endpoint
The /api/merge_image_audio endpoint allows you to create MP4 videos by combining multiple image and audio pairs. Each image is displayed for the duration of its corresponding audio track, making it perfect for creating engaging presentations, tutorials, or storytelling formats.
- Supports both multi-pair videos and single image/audio pair processing.
- Allows for optional image transitions and a default slow zoom effect.
- Compatible with both JSON and multipart/form-data content types.
Parameters for the Merge Request
To utilize the /api/merge_image_audio endpoint effectively, it's essential to understand the parameters you can include in your request. Here's a breakdown of the key parameters:
You can provide arrays of image URLs and audio URLs when combining multiple pairs, or use single image and audio strings for legacy support.
- image_urls - Array of image URLs for multi-pair requests.
- audio_urls - Array of audio URLs that align with the image duration.
- transition_effect - Specify the type of transition effect between images.
- zoom_effect - Enables a slow zoom on images during playback.
Practical Example: Merging Images and Audio
Let’s look at a practical example of how to make a request to the /api/merge_image_audio endpoint using cURL. This example demonstrates how to create a video with transitions and a zoom effect.
Here's how you can structure your cURL request:
curl -X POST https://www.ffmpegapi.net/api/merge_image_audio \n -H 'Content-Type: application/json' \n -d '{ \n "image_urls": ["https://example.com/intro.jpg", "https://example.com/chapter-1.jpg"], \n "audio_urls": ["https://example.com/intro.mp3", "https://example.com/chapter-1.mp3"], \n "transition_effect": "fade", \n "transition_duration": 0.75, \n "dimensions": "1280x720", \n "zoom_effect": true, \n "async": false \n }'
FFMPEGAPI.net is the optimal choice for developers looking to automate video creation processes seamlessly. With its powerful /api/merge_image_audio endpoint, you can quickly combine images and audio without the hassle of server setup or managing FFmpeg infrastructure. The ease of use and flexibility it offers makes it an invaluable tool for SaaS applications, content pipelines, and AI-driven workflows. Start leveraging FFMPEGAPI.net today to enhance your video automation capabilities!