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 const axios = require('axios'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/frame-extractor"; const data = { "video_url": "https://segmind-sd-models.s3.amazonaws.com/display_images/liveportrait-output.mp4", "start_time": "00:00:02", "end_time": "00:00:03", "frame_count": 1, "fps": 1, "output_format": "png" }; (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_urlstr *

URL of the video to be sliced


start_timestr *

Time range slice in format HH:MM:SS


end_timestr *

Time range slice in format HH:MM:SS


frame_countint ( default: 1 )

number of frames

min : 1,

max : 100


fpsint ( default: 1 )

frames per second

min : 1,

max : 100


output_formatenum:str ( default: png )

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

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.