How to trim a video with an API
Cutting a clip to the interesting part is the most common edit there is. By hand it means getting the seek and duration flags right so you do not re-encode or land on the wrong keyframe. Here is the one-call version.
The manual FFmpeg way
Flag order matters: -ss before -i seeks fast but can land on a keyframe, while -c copy avoids a re-encode. A typed API takes start and end seconds and handles the rest.
ffmpeg -ss 2.5 -to 17 -i input.mp4 -c copy trimmed.mp4
Do it with one API call
- 1
Provide the source video
Give a public URL or upload the file and use the returned media URL as the input named "main".
- 2
Call the trim tool
Set start in seconds, and optionally end. Omit end to trim to the finish.
- 3
Download the clip
Poll the job and download the trimmed MP4 from the signed output URL.
curl https://kinopipe.com/api/v1/tools/trim-video \
-H "Authorization: Bearer kp_live_..." \
-H "Content-Type: application/json" \
-d '{
"inputs": [ { "id": "main", "url": "https://example.com/input.mp4" } ],
"options": { "start": 2.5, "end": 17 }
}'FAQ
Are start and end in seconds?
Yes. Both are seconds from the start of the video. Leave out end to trim all the way to the finish.
Does trimming re-encode the video?
KinoPipe cuts to your range and returns a clean MP4, so the clip plays correctly from the first frame.