Thursday, November 14, 2019

Trim videos quickly using FFMPEG

You can easily trim videos using command line on a mac or linux.

On a mac, you'll need to install FFMPEG.  you can get this from homebrew.

If you don't have homebrew, you can install it easily following the one liner instructions from their site.

Install Homebrew
       

 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
       
 



Once Homebrew is installed, then install FFMPEG via homebrew.  Open your terminal and use the following command to install FFMPEG.

       

 brew install ffmpeg
       
 


Then run the following command (substitute your input.mp4 and output.mp4 with desired filenames).

       

  ffmpeg -i input.mp4 -ss 00:10:25 -to 01:18:34 -c:v copy -c:a copy output.mp4
       
 

This will cut your input.mp4 video file.  Start will be 10 minutes and 25 seconds.  The end will be 1 hour 18 minutes and 34 seconds.   Also, this should take only about 5-10 seconds.

Enjoy!