How do I trim video ffmpeg?
Cuts a section out of a video by copying streams, which is effectively instant and lossless.
Cuts a section out of a video by copying streams, which is effectively instant and lossless.
ffmpeg -ss 1 -i https://cdn.rendobar.com/assets/examples/sample.mp4 -t 3 -c copy out.mp4job_7fe6d02b42b84c72
-ss before -i seeks fast but lands on the nearest keyframe, so the cut may not be frame-accurate. -ss after -i is accurate but decodes from the start. With -c copy you are always keyframe-bound regardless, so put -ss first and accept the keyframe, or drop -c copy and re-encode for an exact cut.
Putting -ss after -i decodes to the seek point instead of jumping. Measured on this clip it did something worse than being slow: it produced a 36 KB file with no video stream at all, and did not error.
ffmpeg -i https://cdn.rendobar.com/assets/examples/sample.mp4 -ss 1 -t 3 -c copy out.mp4It did not error. It produced a 36.7 KB file with no video stream at all, where the correct command produced 278.5 KB at 1280x720. Nothing in a normal pipeline would catch that.
job_70c0b453bd9d4c8e
Cuts a section out of a video by copying streams, which is effectively instant and lossless.
-ss before -i seeks fast but lands on the nearest keyframe, so the cut may not be frame-accurate. -ss after -i is accurate but decodes from the start. With -c copy you are always keyframe-bound regardless, so put -ss first and accept the keyframe, or drop -c copy and re-encode for an exact cut.
We ran the naive version too. It did not error. It produced a 36.7 KB file with no video stream at all, where the correct command produced 278.5 KB at 1280x720. Nothing in a normal pipeline would catch that.
Not with Rendobar. The command on this page ran through the API against a URL, with no local FFmpeg and no server. The job id below it is the job that produced these numbers.
This exact command ran through the API against a URL.