Skip to content

Instantly share code, notes, and snippets.

@vishalbandre
Last active July 2, 2023 12:09
Show Gist options
  • Save vishalbandre/6acbf4123ceefc5354e929279e0e19ba to your computer and use it in GitHub Desktop.
Save vishalbandre/6acbf4123ceefc5354e929279e0e19ba to your computer and use it in GitHub Desktop.
For slicing a video:
Syntax:
ffmpeg -i input_video.mp4 -ss START_TIME_IN_THE_FORMAT_00:00:00 -to END_TIME_IN_THE_FORMAT_00:00:00 -vf scale=1280:-1 -c:v libx264 -preset veryfast -crf 23 -c:a copy -f segment -segment_time 60 -reset_timestamps 1 output_%03d.mp4
Sample in action:
ffmpeg -i input_video.mp4 -ss 00:00:19 -to 00:00:39 -vf scale=1280:-1 -c:v libx264 -preset veryfast -crf 23 -c:a copy -f segment -segment_time 60 -reset_timestamps 1 output_%03d.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment