Multi Video Merge
Multi Video Merge
1import requests
2import json
3
4url = "https://api.segmind.com/v1/multi-video-merge"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "video_urls": "https://segmind-inference-inputs.s3.amazonaws.com/81d2475e-b9ae-4292-b0db-401b87011e80-output.mp4",
12 "width": 1920,
13 "height": 1080,
14 "fps": 30,
15 "transition_type": "concat",
16 "transition_duration": 0.5,
17 "maintain_aspect_ratio": true,
18 "audio_handling": "merge"
19}
20
21response = requests.post(url, headers=headers, json=data)
22
23if response.status_code == 200:
24 result = response.json()
25 print(json.dumps(result, indent=2))
26else:
27 print(f"Error: {response.status_code}")
28 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/multi-video-merge"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "video_urls": "https://segmind-inference-inputs.s3.amazonaws.com/81d2475e-b9ae-4292-b0db-401b87011e80-output.mp4",
12 "width": 1920,
13 "height": 1080,
14 "fps": 30,
15 "transition_type": "concat",
16 "transition_duration": 0.5,
17 "maintain_aspect_ratio": true,
18 "audio_handling": "merge"
19}
20
21response = requests.post(url, headers=headers, json=data)
22
23if response.status_code == 200:
24 result = response.json()
25 print(json.dumps(result, indent=2))
26else:
27 print(f"Error: {response.status_code}")
28 print(response.text)API Endpoint
https://api.segmind.com/v1/multi-video-mergeParameters
video_urlsrequiredstring (uri)Array of videos to merge. Can be either:1. Array of URL strings (order by index)2. Array of objects with video_url and orderMinimum 2, maximum 10 videos
audio_handlingoptionalstringHow to handle audio from multiple videos.
"merge""merge""first""none"fpsoptionalintegerOutput video frame rate (frames per second). If 0 or not specified, uses first video's fps.
0Range: 0 - 120heightoptionalintegerOutput video height in pixels. If 0 or not specified, uses first video's height.
0Range: 0 - 4320maintain_aspect_ratiooptionalbooleanMaintain aspect ratio when resizing videos. If true, adds black padding bars. If false, stretches video to fit dimensions.
truetransition_durationoptionalnumberDuration of fade transition in seconds. Only applies when transition_type is 'fade'.
0.5Range: 0.1 - 2transition_typeoptionalstringType of transition between videos.
"concat""concat""fade""none"widthoptionalintegerOutput video width in pixels. If 0 or not specified, uses first video's width.
0Range: 0 - 7680Response Type
Returns: Video
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out