Skip to content

Instantly share code, notes, and snippets.

@le-dawg
Created February 18, 2022 13:59
Show Gist options
  • Save le-dawg/357a9e7249aabfbf166a3d2c1f130e53 to your computer and use it in GitHub Desktop.
Save le-dawg/357a9e7249aabfbf166a3d2c1f130e53 to your computer and use it in GitHub Desktop.
ffmpeg to quickly cut video from start to specific time
# Not many mention this (I'm no expert so maybe there is a catch), but if your file has other streams like subtitles and other metadata like chapters and so on, it's possible to cut/trim and keep all streams with the following command
ffmpeg -to 60 -i input.mkv -map 0 -c copy output.mkv
// With -map 0 you take all the streams in the file, and with -c copy you copy all them as they are.
// Using -to omitting the start via -ss will cut the input video from start to **second 60.**
// Fiddling with map is useful also if you want only specific streams to be kept in the cut (maybe you don't need all the audio sources in the file, or only some subtitles).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment