Extract a specific time range
// what it does
-ss 00:05:00 before -i fast-seeks to the five-minute mark via the index, and -t 30 caps the output at 30 seconds of duration, so together they extract the 5:00–5:30 window; -c copy keeps it fast by copying packets untouched. Note -t sets a length, not an end position — it counts 30 seconds forward from the seek point. Handy for grabbing a fixed-length excerpt without computing an end timestamp.
// shell
$ ffmpeg -ss 00:05:00 -i input.mp4 -t 30 -c copy output.mp4// gotcha
-t is a duration (30 s forward from the 5:00 seek), not an absolute end time. And -to isn't an absolute position in the source here either: because -ss before -i resets the output timestamps to zero, a -to placed after -i is measured from the 5:00 seek point too — so -to 30 would give ~30 s from 5:00 (much like -t 30), not 'stop at 0:30 of the original file.' As with any -c copy trim, the start also snaps to the nearest keyframe.