Resize your video

Featured image

Why

I am using the platform Dlvr.it to schedule some posts on the social media channels. I was just preparing the short video to be posted on LinkedIn for 2022 - to say Happy New Year! The video was just uploading when the platform showed an error to me saying Video dimensions must be smaller than 1280x1024.

Important: Dlvr.it does not support posting videos on LinkedIn with their free account. I do not know whether the paid one allows for this either.

How

I use Ubuntu - a Linux distribution - as my operating system. This gives me the possibility to do a lot of crazy things super quickly and easily - while using the terminal. It looks like this:

Terminal Image

This should not scare you. If you are using Ubuntu, I can help you resize your videos in 2 siple steps!

What I did - step by step

Step 1: Find the original dimensions of the video

sudo apt install ffmpeg # installed the ffmpeg library, which allows me to use ffprobe

# FIND VIDEO DIMENSIONS
ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 MY_VIDEO.mp4


>> 4072x2036

Okay, so my original video’s dimension are 4072 pixels by 2036 pixels.

Step 2: Discover the new dimensions and resize

The Dlvr.it error was telling me Video dimensions must be smaller than 1280x1024.

So I need to jump down from 4072 pixels to 1280. Okay, that’s easy. Secondly, I need to see what 2036 pixels needs to be replaced with.

I divide 4072 by 1280. The result is 3,18125. So now I simply divide 2036 by that number, 3,18125 - and get 640 pixels.

My new video dimensions are 1280 pixels by 640 pixels. Now let’s resize it:

ffmpeg -i MY_VIDEO.mp4 -vf scale=1280:640 MY_VIDEO_resized.mp4

This is it.

Further Reading

This is the blog post which I read to find my solution.

Credits

Cover Image Credit: Wahid Khene on Unsplash

Terminal Image Credit: Gabriel Heinzer on Unsplash