In the age of digital content, the ability to combine images and audio into engaging videos is essential for developers. FFMPEGAPI.net provides a powerful hosted REST API that eliminates the need for server setup while delivering seamless video processing capabilities. This article will guide you through how to use the Image and Audio Merge endpoint to create stunning MP4 videos from your media assets.
Getting Started with FFMPEGAPI.net
FFMPEGAPI.net is designed for developers seeking an efficient cloud solution for video and audio processing. With features like API-key authentication, you can integrate it into your projects without worrying about server management.
- No server setup required.
- API-key authentication for security.
- Ideal for automation and SaaS applications.
Understanding the Image and Audio Merge Endpoint
The Image and Audio Merge endpoint allows you to create an MP4 video by combining image/audio pairs. Each image is displayed for the duration of its corresponding audio file. This feature is perfect for creating video presentations, tutorials, or any content where visuals and sound need to be synced.
- Endpoint: POST /api/merge_image_audio
- Combine multiple image/audio pairs effortlessly.
- Support for various transition effects and zoom.
Constructing Your Request
When using this endpoint, you can either send single image/audio pairs or multiple pairs using arrays. Here’s a sample JSON request structure to illustrate how to combine images and audio effectively.
- Use 'image_urls' and 'audio_urls' arrays for multiple pairs.
- Optionally specify 'transition_effect' and 'zoom_effect'.
- Asynchronous processing is available with 'async' flag.
{
"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
}
Making Your API Call
To make a call to the /api/merge_image_audio endpoint, you can use tools like curl or libraries in Python to send your request easily. Below is an example using curl and Python to demonstrate how you can interact with the FFMPEGAPI.net service.
- Make video creation simple with just a few lines of code.
- Use the API in various programming environments.
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}'
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())
FFMPEGAPI.net is the best choice for developers looking for a hosted solution for video and audio processing. With its straightforward API, robust features, and no server management required, you can focus on building your applications while FFMPEGAPI.net handles the heavy lifting of media manipulation. Start merging images and audio today to create captivating videos effortlessly!