Skip to content

Instantly share code, notes, and snippets.

@gautamkrishnar
Last active April 29, 2023 09:21
Show Gist options
  • Save gautamkrishnar/0e3585d03de12f85b55bc5278a6cc44f to your computer and use it in GitHub Desktop.
Save gautamkrishnar/0e3585d03de12f85b55bc5278a6cc44f to your computer and use it in GitHub Desktop.
Script to add alias to cut / trim any video file using ffmpeg faster

Usage

cutvid <source video> <destination video> <start time> <end time>

example:

cutvid bigBucksBunny.mp4 bigBuck1.mp4 00:01:00 00:02:10

How to use

  1. Copy script.sh contents
  2. Paste it to .zshrc or .bashrc of your terminal. If you dont know how to do that, Google it or ask ChatGPT.
cutvid () {
set -x
ffmpeg -ss "${3}" -to "${4}" -i "${1}" -c copy "${2}"
set +x
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment