Stitch
POST /v1/stitch
Join multiple video or image clips into a single output file in sequence. This is a simpler alternative to the full render endpoint when you just need to concatenate clips.
Request
| Field | Type | Required | Description |
|---|---|---|---|
clips | array | Yes | Array of clip objects to join in order |
output | object | Yes | Output format and resolution |
callback | string | No | Webhook URL for completion notification |
Each clip object:
| Field | Type | Required | Description |
|---|---|---|---|
src | string | Yes | URL of the video or image file |
trim | number | No | Trim from start (seconds) |
length | number | No | Duration to include (seconds, for images and trimming) |
Example: Joining 3 Clips
curl
curl -X POST https://api.vidiking.com/v1/stitch \
-H "Authorization: Bearer $VIDIKING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"clips": [
{
"src": "https://example.com/intro.mp4"
},
{
"src": "https://example.com/main-content.mp4",
"trim": 5,
"length": 30
},
{
"src": "https://example.com/outro.mp4"
}
],
"output": {
"format": "mp4",
"resolution": "hd"
}
}'
Node.js
const { jobId } = await client.stitch({
clips: [
{ src: 'https://example.com/intro.mp4' },
{ src: 'https://example.com/main-content.mp4', trim: 5, length: 30 },
{ src: 'https://example.com/outro.mp4' },
],
output: { format: 'mp4', resolution: 'hd' },
});
Python
result = client.stitch({
"clips": [
{"src": "https://example.com/intro.mp4"},
{"src": "https://example.com/main-content.mp4", "trim": 5, "length": 30},
{"src": "https://example.com/outro.mp4"},
],
"output": {"format": "mp4", "resolution": "hd"},
})
Response
{
"id": "job_stitch_456",
"status": "QUEUED",
"created_at": "2025-01-15T10:30:00Z"
}
Mixing Images and Video
You can stitch images and videos together. For images, set the length to control how long each image is shown.
curl -X POST https://api.vidiking.com/v1/stitch \
-H "Authorization: Bearer $VIDIKING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"clips": [
{ "src": "https://example.com/photo1.jpg", "length": 3 },
{ "src": "https://example.com/video-clip.mp4" },
{ "src": "https://example.com/photo2.jpg", "length": 3 }
],
"output": { "format": "mp4", "resolution": "hd" }
}'
Cost
Stitch operations cost $0.14 per job regardless of the number of clips or output duration.
When to Use Stitch vs Render
- Stitch is for simple concatenation -- joining clips in sequence without overlays, transitions, or multi-track composition.
- Render gives you full control over timeline composition with tracks, transitions, effects, and overlays.
If you need transitions between clips, use the render endpoint with clips on a single track and transition properties.