POST
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 import requests import base64 # Use this function to convert an image file from the filesystem to base64 def image_file_to_base64(image_path): with open(image_path, 'rb') as f: image_data = f.read() return base64.b64encode(image_data).decode('utf-8') # Use this function to fetch an image from a URL and convert it to base64 def image_url_to_base64(image_url): response = requests.get(image_url) image_data = response.content return base64.b64encode(image_data).decode('utf-8') api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/video-audio-merge" # Request payload data = { "input_video": "https://segmind-sd-models.s3.amazonaws.com/display_images/video-audio-merge-input.mp4", "input_audio": "https://segmind-sd-models.s3.amazonaws.com/display_images/audio-merge-input-aud.mp3", "video_start": 0, "video_end": -1, "audio_start": 0, "audio_end": -1, "audio_fade_in": 0, "audio_fade_out": 0, "override_audio": False, "merge_intensity": 0.5 } headers = {'x-api-key': api_key} response = requests.post(url, json=data, headers=headers) print(response.content) # The response is the generated image
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


input_videostr *

URL of the input video to be merged


input_audiostr *

URL of the input audio to be merged with the video


video_startfloat ( default: 1 )

Start time of the video in seconds


video_endfloat ( default: -1 )

End time of the video in seconds (-1 for full duration)

min : -1,

max : 3600


audio_startfloat ( default: 1 )

Start time of the audio in seconds

min : 0,

max : 3600


audio_endfloat ( default: -1 )

End time of the audio in seconds (-1 for full duration)

min : -1,

max : 3600


audio_fade_infloat ( default: 1 )

Duration of audio fade-in effect in seconds

min : 0,

max : 10


audio_fade_outfloat ( default: 1 )

Duration of audio fade-out effect in seconds

min : 0,

max : 10


override_audioboolean ( default: 1 )

Whether to completely replace the original video audio


merge_intensityfloat ( default: 0.5 )

Intensity of audio merging (0.0 to 1.0)

min : 0,

max : 1

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Video Audio Merge Model: Seamlessly Combine Audio and Video

Optimize your multimedia projects with our cutting-edge Video Audio Merge model. Effortlessly combine audio tracks with video files to create a cohesive and engaging viewer experience. Perfect for content creators, filmmakers, and marketing professionals.

Key Features of Video Audio Merge Model

  1. Intuitive Interface
  • Drag-and-Drop Functionality: Easily upload video and audio files with a simple drag-and-drop feature.

  • URL Uploads: Seamlessly integrate files via URL for fast processing.

  1. Customizable Timing
  • Video and Audio Timing: Set precise video and audio start and end times to ensure perfect synchronization.

  • Fade Effects: Customize audio fade-in and fade-out durations for smooth transitions.

  1. Advanced Audio Options
  • Override Original Audio: Option to completely replace the original video audio with the new track.

  • Merge Intensity: Adjust merge intensity levels for balanced audio-video integration.

Benifits of Video Audio Merge Model

  • Enhanced Production Quality: Create professional-grade videos with precisely synchronized audio.

  • Time-Efficient: Save time with an easy-to-navigate interface and fast processing.

  • Versatile Usability: Ideal for social media posts, advertisements, vlogs, and more.