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
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/video-concatenate";
const data = {
"video1": "https://segmind-resources.s3.amazonaws.com/input/sample1-sunflower.mp4",
"video2": "https://segmind-resources.s3.amazonaws.com/input/sample2.mp4",
"direction": "horizontal",
"spacing": 10,
"spacing_color": "#FFFFFF",
"size_adjustment": "reduce_biggest",
"audio_source": "video2",
"crf": 24,
"preset": "fast"
};
(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);
}
})();First input video URL. Use high-quality videos for best output.
Second input video URL. Match quality with Video 1 for consistency.
Concatenation direction. Use 'horizontal' for side-by-side, 'vertical' for stacking.
Allowed values:
Pixels space between videos. Increase for clear separation.
min : 0,
max : 2000
Color of spacing in hex. Use black (#000000) or white (#FFFFFF) for contrast.
Adjust size for uniformity. Use 'magnify_smallest' for smaller to match larger.
Allowed values:
Audio source choice. Use 'none' for silent output.
Allowed values:
H.264 quality (CRF). Lower values for better quality, higher for smaller file.
min : 0,
max : 51
Encoding speed. 'Fast' saves time, 'Medium' for balance, 'Slow' for quality.
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.
Video Concatenate is a specialized AI model designed for seamless video merging workflows. It combines two video inputs into a single output file, offering developers precise control over orientation (horizontal or vertical), spacing, size normalization, and audio selection. Built for automation, this model handles the complexity of video format alignment, resolution matching, and encoding optimization—eliminating manual video editing steps in production pipelines. Whether you're building social media tools, comparison dashboards, or multi-camera recording systems, Video Concatenate provides API-first video processing with consistent, high-quality results.
Social Media Content Creation: Generate split-screen comparison videos, before/after transformations, or reaction videos with synchronized playback.
E-Learning Platforms: Combine instructor footage with screen recordings or presentation slides for educational content.
Sports and Gaming Analysis: Create side-by-side performance comparisons, replays with commentary, or multi-angle event coverage.
Product Demonstrations: Showcase product features alongside user testimonials or competitive comparisons in marketing materials.
Surveillance and Monitoring: Merge camera feeds from different angles for security review or incident analysis dashboards.
reduce_biggest to prevent upscaling blur, or crop_biggest when aspect ratio consistency matters more than full frames.fast for quick iterations during development, medium for production, slow for final renders requiring maximum compression efficiency.video1 for primary narration preservation, video2 for background music retention, or none for voiceover workflows.What video formats does Video Concatenate support?
The model accepts MP4 videos with H.264 encoding via HTTPS URLs. Other formats may process but could produce inconsistent results.
How does size adjustment affect video quality?
reduce_biggest downscales the larger video to match the smaller one, preserving sharpness. magnify_smallest upscales but may introduce blur. crop_biggest maintains resolution by trimming excess dimensions.
Can I concatenate videos with different aspect ratios?
Yes. The size adjustment parameter handles mismatched dimensions, though reduce_biggest or crop_biggest produces the most visually consistent results.
What's the difference between CRF values?
Lower CRF (0-18) = higher quality, larger files. Higher CRF (28-51) = compressed quality, smaller files. CRF 24 offers near-lossless quality with reasonable file sizes for most applications.
Which encoding preset should I use for production?
fast balances speed and compression for real-time applications. medium is recommended for production workflows requiring efficient encoding. slow or slower maximize compression efficiency when processing time isn't critical.
Does the model preserve video metadata and embedded subtitles?
The model focuses on visual and audio concatenation. Metadata like timestamps and subtitles may not transfer—re-apply them post-processing if needed.