trim video ffmpeg
Trim video with FFmpeg
If you are trying to trim a video in FFmpeg, you can either write the CLI command yourself or use the same workflow through an online tool and API. This page covers both approaches, so you can cut a clip quickly and then automate the same job when you need to.
FFmpeg CLI
How to trim a video in FFmpeg
The most common FFmpeg trim command uses a start time, an end time, and an output file. If you are looking for a straightforward way to cut a video with FFmpeg, this is the best place to start.
FFmpeg trim command
Click any part of the command to see what it does.
FFmpeg trim command
ffmpeg
This runs the FFmpeg binary itself. Everything that follows tells FFmpeg which input to read, where the clip should start and end, and how to encode the trimmed output.
API
Use the same trim video workflow through the FFmpeg API
If you need FFmpeg video trimming inside your own product, app, or backend workflow, the FFmpeg API gives you a faster path than building and maintaining media infrastructure yourself. You can send a ready-to-use args-based trim request, keep integration simple, and ship production FFmpeg capability without the usual setup and ops overhead.
Request
curl -X POST https://ffmpeg-api.cloud/v1/jobs \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ffmpegArgs": [
"-y",
"-i",
"{{input}}",
"-ss",
"00:00:03",
"-to",
"00:00:08",
"-c:v",
"libx264",
"-preset",
"veryfast",
"-crf",
"18",
"-c:a",
"aac",
"-b:a",
"128k",
"-movflags",
"+faststart",
"{{output}}"
],
"inputs": {
"input": {
"type": "url",
"url": "https://example.com/input.mp4"
}
},
"outputs": {
"output": {
"fileName": "trimmed-output.mp4"
}
}
}'Response
{
"jobId": "job_01hxyz...",
"status": "queued",
"runtimeSeconds": 0,
"creditsCharged": 0,
"createdAt": "2026-04-14T10:30:00.000Z"
}Online tool
Try this FFmpeg API trim video tool online
Upload a source video, set the start and end time, and run the trim job directly in the browser. It is the quickest way to test the workflow before you wire it into your own app or backend.
Live playground
Trim video with FFmpeg
Cut a video clip by start time and end time, then inspect the matching FFmpeg API request.
Use cases
Common ways to use FFmpeg video trimming
Trimming is useful when you want to cut a clip, shorten a recording, remove extra seconds, or prepare a smaller segment for another workflow.
Cut highlights from longer videos
Trim video clips for demos, social uploads, onboarding videos, or product previews without keeping the full source length.
Remove intros, outros, or dead space
Use FFmpeg video trimming when you need to cut away pauses, title cards, or extra footage from the beginning or end of a clip.
Prepare shorter uploads for product workflows
Trim user-generated videos before moderation, transcription, previews, or downstream processing inside your own app.
FAQ
FFmpeg trim video FAQ
Common questions about trimming video with FFmpeg, cutting MP4 clips, and moving the same workflow into the FFmpeg API.
Related templates
Other FFmpeg templates
Explore other FFmpeg templates for compression, resize, thumbnails, and more.
