Use
the following command to compress the PDF to a "screen" quality, which
is usually sufficient for viewing on monitors or emailing and will
easily bring a 3MB file below 2MB:
To crop a video on Ubuntu, you use FFmpeg’s crop filter. Cropping is different from resizing; it’s like taking a pair of scissors to the video frame to cut out a specific area (like removing a watermark or focusing on a specific person).
The logic for cropping is: crop=width:height:x:y
1. The Basic Crop Command
If you know the exact dimensions you want to keep, use this:
Trying to guess "X" and "Y" coordinates in a terminal is hard. Here is a trick to do it visually:
Open your video in VLC.
Go to Tools > Effects and Filters.
Go to Video Effects > Crop.
Type in numbers until the video looks exactly how you want it.
Write down those numbers (Left, Right, Top, Bottom) and use them in this FFmpeg command:
Bash
# If you found: Left=100, Top=50, Width=800, Height=600
ffmpeg -i input.mp4 -vf "crop=800:600:100:50" -c:a copy output_cropped.mp4
Important Tips:
Re-encoding: Because you are changing the actual picture, FFmpeg has to re-encode the video. I didn't include quality flags above to keep it simple, but for the best result, add -crf 20:
ffmpeg -i input.mp4 -vf "crop=w:h:x:y" -c:v libx264 -crf 20 -c:a copy output.mp4
Even Numbers: Just like before, H.264 (MP4) loves even numbers. If you get an error, make sure your width and height are divisible by 2.