Frame extractor

Frame extractor

~4.74s
~$0.001
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/frame-extractor"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "video_url": "https://segmind-sd-models.s3.amazonaws.com/display_images/liveportrait-output.mp4",
12    "start_time": "00:00:02",
13    "end_time": "00:00:03",
14    "frame_count": 1,
15    "fps": 1,
16    "output_format": "png"
17}
18
19response = requests.post(url, headers=headers, json=data)
20
21if response.status_code == 200:
22    result = response.json()
23    print(json.dumps(result, indent=2))
24else:
25    print(f"Error: {response.status_code}")
26    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/frame-extractor

Parameters

end_timerequired
string

Time range slice in format HH:MM:SS

Default: "00:00:02,00:00:03"
start_timerequired
string

Time range slice in format HH:MM:SS

Default: "00:00:02,00:00:03"
video_urlrequired
string (uri)

URL of the video to be sliced

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/liveportrait-output.mp4"
fpsoptional
integer

frames per second

Default: 1Range: 1 - 100
frame_countoptional
integer

number of frames

Default: 1Range: 1 - 100
output_formatoptional
string

Select the output format of the output. For multiple frames only it will return with zip format

Default: "png"
Allowed values :
"png""zip"

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