Winxvideo AI

Home > Video > Resize Video > FFmpeg Resize Video

Updated by Kaley Torres- | Contact Author

FFmpeg Resize Video: How to Scale Videos in FFmpeg Easily?

Nowadays, video content has been a crucial aspect of online communication. However, a short raw video with a resolution of 1920x1080 may takes GBs storage space on your devices, not to mention the 4K UHD videos. Having a couple of videos could fill up all your storage space. Moreover, different platforms and devices often require videos of specific sizes and dimensions. That's where FFmpeg, a powerful open-source multimedia framework, comes into play. In this article, you'll find a comprehensize guide for resizing video using FFmpeg, so as to present your videos online or save on the devices with the best fit sizes and dimensions.

Part 1. How to Install FFmpeg on Your Computer

FFmpeg is a free command-line tool that is able to convert both video and audio file formats on Windows, Mac and Linux. It has got a very powerful scale filter, which can be used to resize videos with various command lines. You can change your video resolution and simultaneously retain its aspect ratio for a file size reduction by using FFmpeg.

Now, let's check the detailed steps of FFmpeg resize video.

Step 1. Free download FFmpeg on your computer.

Navigate to https://ffmpeg.org/download.html, the official download website of FFmpeg. Pick the operating system that your computer runs on. Take Windows as an example. Select and click Windows builds from gyan.dev by clicking it. You will be taken to a new exe download page by this. In the new window, you can find different versions of FFmpeg. Click on what you need and download the zip package.

Download FFmpeg Zip File

Step 2: Install FFmpeg for video resizing.

1. Unzip the downloaded FFmpeg zip file, and you can find the FFmpeg.exe file under the bin.

Find FFmpeg exe

2. Setting up Environment Variables will make it easier to run commands later on the CLI.

  1. Just open the "Edit the system environment variables" in start menu.
  2. Click on the "Environment Variables" option.
  3. Find the "Path" under the System variables, double-click on it.
  4. Click on the New button, paste the absolute path to the bin directory in the ffmpeg folder and click OK to save. Here my bin path goes for:
C:\Program Files (x86)\ffmpeg-2022-11-03-git-5ccd4d3060-full_build\bin
Configuring Environment Variables

3. Just open the cmd Command Prompt, type in ffmpeg -version and press the Enter on the keyboard to check whether FFmpeg is installed or not on your computer. If it's installed successfully, you'll see the ffmpeg version like below.

FFmpeg installed successfully

Part 2. Different FFmpeg Command Lines for Resizing Video

Before using FFmpeg to resize videos, you need to determine the format, name and the file path of your files. This will make it more manageable when resizing videos with FFmpeg. To determine your file format, right-click and head over to properties. Rename it to a shorter one could be more convenient to input it in FFmpeg.

Now, you're able to rescale video in FFmpeg using different command lines.

Open the cmd Command Prompt window. Then type in the video scaling command line according to your needs.

1. Simple Rescaling in FFmpeg

ffmpeg -i input.mp4 -vf scale=$w:$h output.mp4

The $w and $h denote the required width and height of the destination video. For example, you're planning to resize video to 1280 x 720, you could use -vf scale=1280:720.

FFmpeg Resize Video

2. Resize Video While Keeping High Quality with FFmpeg

ffmpeg -i input.mp4 -vf scale=1280:720 -preset slow -crf 18 output.mp4

Here, you're telling FFmpeg to scale the video to 720p and then encode it using crf=18 with libx264's slow preset that usually provides very good quality due to the number of coding tools that it turns on. BTW, according to ffmpeg documentation, about codec h264, CRF 18 is considered lossless to human eyes without using analysis tool.

3.  Resize Video Resolution But Keep the Aspect Ratio Using FFmpeg

In FFmpeg, if you wish to scale a video while keeping its aspect ratio, you need to set either one of the height or width parameter and set the other parameter to -1. That is if you set the height, then set the width to -1 and vice-versa. Take a 1920 x 1080 HD video as an example:

ffmpeg -i input.mp4 -vf scale=1280:-1 output.mp4

The resulting video will have a resolution of 1280x720. This is because 1920 / 1280 = 1.5. Thus, the height is scaled to 1080 / 1.5 = 720 pixels.

ffmpeg -i input.mp4 -vf scale=-1:360 output.mp4

The resulting video will have a resolution of 640x360. This is because 1080 / 360 = 3. Thus, the height is scaled to 1920 / 3= 640 pixels.

4. Use Variables to Resize Video in FFmpeg

Of course, using variables can also help you resizing videos in FFmpeg. That mean you can specify width and height in times. Usually, the input video's width and height are denoted by iw and ih respectively.

ffmpeg -i input.mp4 -vf scale=iw*2:ih output.mp4

This means you will scale the video's width two times (2x) while retainling the original height. If you want to divide either the height or width by a number, the syntax changes a little as the scale=iw/2:ih/2 argument need to be enclosed within double quotes.

ffmpeg -i input.mp4 -vf "scale=iw/2:ih/2" output.mp4

Part 3. An Easier Way to Resize Video with Winxvideo AI - More Recommended

As above, you'll be able to compress video with FFmpeg theoretically. However, there is another situation - you're totally confused by the complicated installation steps and various command lines, especially for the novice. If you're one of them, try Winxvideo AI, an easier video resizer for rescaling videos.

Winxvideo AI has an intuitive and easy-to-use interface, allowing you to resize video within steps. By using it, you can reduce video file size through converting video codec/format, cutting out unwanted parts, lowering down video resolution/frame rate/bit rate, etc. It has no noticeable quality loss after compression with the built-in HQ engine and de-interlacing engine. Moreover, you'll experience a blazing fast video resizing speed with the support of hardware acceleration.

How to Reduce Video File Size Using Winxvideo AI

Step 1. Free download Winxvideo AI on your Windows or Mac computer, depending on what you're running on. Install and open it.

Step 2. Drag and drop or click the "+Video" button to load the video that you want to resize. You can import multiple videos at once for batch processing.

Step 3. Choose a format for the video. You can continue the original format, or convert your video to MP4, MOV, WMV, HEVC, H.264, WebM and 420+ preset profiles.

 

an easier way to resize video

Step 4. Click on the Settings button to enter the parameters adjusting window, where you can downscale video resolution, lower video bitrate and frame rate, and change video aspect ratio. Just adjust your video parameters as you need.

Step 5. Optionally, by clicking on the "Edit" button, you can also trim the video length, crop the video frame size to match the size and dimension of different platforms and devices.

Step 6. Click the RUN button to start resizing your video. It will be finished in a very short time with the support of hardware acceleration.

Conclusion

For experienced user, it's certainly feasible to resize video using FFmpeg since they have a good understanding of the command and FFmpeg is able to handle almost any media-related work, including conversion, compression, transition and more. But for the beginners, they are highly recommended to resize video using Winxvideo AI, which doesn't require any complicated operations. Of course, it is also a very good choice for experienced users. After all, no one can resist a simpler method.

ABOUT THE AUTHOR

author - Kaley Torres

Kaley Torres twitter icon

Kaley Torres is a self-motivated, creative editor with eight years of marketing and SEO experience, specializing in writing on DVD, video, audio, images, new digital contents etc. With a partiality DVD collection, Kaley also enjoys digitizing DVD and is keen to share her DVD video conversion solutions as well as video sharing tips on social media.

Home > Video > Resize Video > FFmpeg Resize Video