Video Loop

Effortlessly loop videos for engaging social media & storytelling with our Video Loop.

~8.60s
~$0.001
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/video-loop"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "input_video": "https://segmind-resources.s3.amazonaws.com/input/c08771b9-b671-4c12-9ea7-af4048b9d194-894a8bdf-6064-40ea-a78d-06c1abff262b.mp4",
12    "loop_count": 2,
13    "loop_type": "normal",
14    "include_audio": true,
15    "base64": false
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21    result = response.json()
22    print(json.dumps(result, indent=2))
23else:
24    print(f"Error: {response.status_code}")
25    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/video-loop

Parameters

input_videorequired
string (uri)

URL of the input video to be processed

base64optional
boolean

Whether to return the output video as a base64 encoded string

Default: false
include_audiooptional
boolean

Whether to include audio from the original video in the output

Default: true
loop_countoptional
integer

Number of times to loop the video

Default: 2Range: 1 - 15
loop_typeoptional
string

Type of loop effect to apply to the video

Default: "normal"
Allowed values :
"normal""boomerang"

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