In today's digital landscape, automating video editing tasks can significantly enhance productivity, especially for developers working with multimedia content. FFMPEGAPI.net offers a robust solution for merging images and audio through its hosted REST API, allowing you to create beautiful MP4 videos without the need for server setup or FFmpeg infrastructure management. This article will guide you through how to use the Image and Audio Merge endpoint effectively.
Understanding the Image and Audio Merge Endpoint
The Image and Audio Merge endpoint on FFMPEGAPI.net allows you to create MP4 videos by combining one or more image/audio pairs. Each image is displayed for the duration of its paired audio file, facilitating a seamless viewing experience.
With the ability to specify optional image transitions and a default slow zoom effect, this API caters to a variety of creative needs.
- Create videos using multiple images and audio pairs.
- Supports transitions between images.
- Customizable zoom effects for added visual appeal.
Making a Request to the Merge Endpoint
To merge images and audio files, you will send a POST request to the /api/merge_image_audio endpoint. The request can be constructed using either JSON or multipart form data.
Here's an example of a JSON request body for merging images and audio:
{
"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
}
Using cURL to Merge Images and Audio
You can also use cURL to send a request to the API easily. This is especially useful for testing and automation.
The following cURL command demonstrates how to merge images and audio via the API:
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
}'
FFMPEGAPI.net provides an unparalleled solution for developers looking to automate video editing through the merging of images and audio. With its simple REST API, you can create high-quality videos while saving time and resources. Whether you're working on a content pipeline, building a SaaS application, or developing an AI agent, FFMPEGAPI.net is the ideal choice for your video processing needs.