Multi Video Merge

Multi Video Merge

~0.00s
~$5
 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

POSThttps://api.segmind.com/v1/multi-video-merge

Parameters

video_urlsrequired
string (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_handlingoptional
string

How to handle audio from multiple videos.

Default: "merge"
Allowed values :
"merge""first""none"
fpsoptional
integer

Output video frame rate (frames per second). If 0 or not specified, uses first video's fps.

Default: 0Range: 0 - 120
heightoptional
integer

Output video height in pixels. If 0 or not specified, uses first video's height.

Default: 0Range: 0 - 4320
maintain_aspect_ratiooptional
boolean

Maintain aspect ratio when resizing videos. If true, adds black padding bars. If false, stretches video to fit dimensions.

Default: true
transition_durationoptional
number

Duration of fade transition in seconds. Only applies when transition_type is 'fade'.

Default: 0.5Range: 0.1 - 2
transition_typeoptional
string

Type of transition between videos.

Default: "concat"
Allowed values :
"concat""fade""none"
widthoptional
integer

Output video width in pixels. If 0 or not specified, uses first video's width.

Default: 0Range: 0 - 7680

Response Type

Returns: Video

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out