Trim a video

Trim a video from a given start time mm:ss to an end time mm2:ss2 (omit the -to flag to trim till the end)

Recipe Parameters
output.sh
ffmpeg -i path/to/input_video.mp4 -ss mm:ss -to mm2:ss2 [-c|-codec] copy path/to/output_video.mp4
Warm Reminder

Project Under Development

This project is still in development and may contain errors. Please use with caution.

# Why use this command?

This command is crucial for video processing. Trim a video from a given start time mm:ss to an end time mm2:ss2 (omit the -to flag to trim till the end). By using FFmpeg's advanced encoding libraries, you ensure the best possible quality/size ratio.

# Parameter Explanation

The command constructs a filter graph that processes the input stream. Key flags like -c:v (codec) and -crf (quality) determine the final output properties.

path/to/input_video.mp4Input Video File configuration
mm:ssStart Time (mm:ss) configuration
mm2:ss2End Time (mm:ss) configuration
[-c|-codec]Codec Option configuration
path/to/output_video.mp4Output Video File configuration

Common Errors & Solutions

"Video freezes at the start"

When using '-c copy', the cut point might not be on a keyframe. Remove '-c copy' to re-encode for frame-accurate cuts.

Related Tools in Video