POST
javascript
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 const axios = require('axios'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/multi-video-merge"; const data = { "video_urls": "https://segmind-inference-inputs.s3.amazonaws.com/81d2475e-b9ae-4292-b0db-401b87011e80-output.mp4", "width": 1920, "height": 1080, "fps": 30, "transition_type": "concat", "transition_duration": 0.5, "maintain_aspect_ratio": true, "audio_handling": "merge" }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
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


video_urlsstr *

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


widthint ( default: 1 )

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

min : 0,

max : 7680


heightint ( default: 1 )

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

min : 0,

max : 4320


fpsint ( default: 1 )

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

min : 0,

max : 120


transition_typeenum:str ( default: concat )

Type of transition between videos.

Allowed values:


transition_durationfloat ( default: 0.5 )

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

min : 0.1,

max : 2


maintain_aspect_ratioboolean ( default: true )

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


audio_handlingenum:str ( default: merge )

How to handle audio from multiple videos.

Allowed values:

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.