How to Crop Videos

By  on  

During a recent episode of the Script and Style podcast, I had noticed that the video recording had showed a bit of our internal chat that wasn't necessary for our viewers to see. While there's nothing wrong with giving viewers a peek into the show preparation, presenting the best possible video is our priority. So how can we crop a video via command line?

The amazing ffmpeg utility allows engineers to crop videos with one easy to use filter:

# Crop an image to 500x500 starting at 0x0
ffmpeg -i sns-episode.webm -filter:v "crop=500:500:0:0" sns-episode-cropped.mp4

The crop filter format is easy to follow: {desired_width}:{desired_height}:{start_x}:{start_y}.

I've written dozens of posts about ffmpeg and how it has the power to manipulate videos in amazing ways. Now you know how to crop videos quickly from command line!

Recent Features

  • By
    Creating Scrolling Parallax Effects with CSS

    Introduction For quite a long time now websites with the so called "parallax" effect have been really popular. In case you have not heard of this effect, it basically includes different layers of images that are moving in different directions or with different speed. This leads to a...

  • By
    Responsive Images: The Ultimate Guide

    Chances are that any Web designers using our Ghostlab browser testing app, which allows seamless testing across all devices simultaneously, will have worked with responsive design in some shape or form. And as today's websites and devices become ever more varied, a plethora of responsive images...

Incredible Demos

Discussion

    Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!