In the fast-paced world of media production, developers need efficient and reliable tools for audio and video processing. FFMPEGAPI.net offers a powerful hosted REST API that simplifies the process of merging images and audio to create engaging MP4 videos. In this article, we will explore how to use the Image and Audio Merge feature to streamline your media workflows.
What is the Image and Audio Merge Feature?
The Image and Audio Merge feature of FFMPEGAPI.net allows you to combine one or more image/audio pairs into a single MP4 video. This is particularly useful for creating presentations, educational materials, or promotional content where visuals need to sync with audio. Each image is displayed for the duration of its corresponding audio file, making it easy to create multimedia projects with minimal effort.
- Supports multiple image/audio pairs.
- Allows custom transition effects between images.
- Includes a default slow zoom effect for dynamic presentations.
How to Use the Merge API Endpoint
To merge images and audio using the FFMPEGAPI.net, you need to make a POST request to the endpoint '/api/merge_image_audio'. The request can be made using JSON or multipart form data, allowing for flexibility based on your application needs.
- Use 'image_urls' and 'audio_urls' arrays for multiple pairs.
- For a single image/audio pair, use 'image' and 'audio' parameters.
import requests
url = 'https://www.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())
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,"async":false}'
Parameters Explained
When creating a request to the merge endpoint, you can specify various parameters to customize your output. Here's a breakdown of key parameters you can use:
- image_urls: An array of image URLs for multi-pair requests.
- audio_urls: An array of audio URLs that dictate the duration of each image.
- transition_effect: Specifies the transition effect between images.
- transition_duration: Sets the duration of the transition effects.
- dimensions: Defines the output video dimensions.
FFMPEGAPI.net provides an easy-to-use, hosted solution for merging images and audio without the need for server management or complex setups. Whether you're building automation tools, SaaS applications, or content pipelines, our API allows you to focus on development while we handle the heavy lifting. Explore how FFMPEGAPI.net can enhance your media workflows today!