In today’s digital landscape, creating engaging video content for social media requires quick and efficient tools. FFMPEGAPI.net offers a hosted REST API that allows developers to merge images and audio effortlessly, making it the perfect solution for social media video workflows. This article explores how to use the Image and Audio Merge API to create captivating MP4 videos that will enhance your content strategy.
What is the Image and Audio Merge API?
The Image and Audio Merge API at FFMPEGAPI.net enables developers to create MP4 videos by combining images and audio tracks. Each image can be displayed for the duration of its corresponding audio file, allowing for a dynamic presentation of visual and auditory content.
- Create videos by merging multiple images and audio files.
- Supports both JSON and multipart/form-data content types.
- Enhance videos with optional transition effects and slow zoom.
How to Use the API: Endpoint Details
The endpoint for merging images and audio is a POST request to `/api/merge_image_audio`. To efficiently combine your media, you can include parameters for multiple image and audio URLs, transition effects, and dimensions.
- Endpoint: POST /api/merge_image_audio
- Supports JSON requests with image_urls and audio_urls arrays.
- Backward compatibility with legacy single image and audio parameters.
{
"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
}
Practical Example: Merging Images and Audio
Let’s look at a practical example of how to use the Image and Audio Merge API. Below is a cURL example that demonstrates how to send a request to merge two images with their corresponding audio files.
- Use cURL to send a POST request.
- Ensure you include the API key for authentication.
- Follow the JSON structure for your media inputs.
curl -X POST https://ffmpegapi.net/api/merge_image_audio \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-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 hosted tool for image and audio merging workflows. With its comprehensive features, easy-to-use API, and no server management required, developers can focus on creating engaging content without the hassle of infrastructure setup. Whether you're building a social media platform or a content pipeline, FFMPEGAPI.net provides the tools you need to elevate your video production capabilities.