ffmpeg -i <input_file> -ss <start_time> -to <end_time> -c:v copy -c:a copy <output_file>
ffmpeg -i <input_file> -ss <start_time> -t <duration> -c:v copy -c:a copy <output_file>
-i <input_file>- input file name (e.g.input.mp4)-ss <start_time>- sets the start time offset, formatHH:MM:SS.mor specified as a number ofseconds(e.g.30)-to <end_time>- sets the end time offset, formatHH:MM:SS.mor specified as a number ofseconds(e.g.30)-t <duration>- sets the duration to be cut, specified as a number ofseconds(e.g.30)-c:v copy- copy video codec from the input file-c:a copy- copy audio codec from the input file<output_file>- output file name (e.g.output.mp4)
Note: if both -t and -to are specified, only -t will be used