

If you want to scale the video file without upscaling the dimensions, you will use the min expression. To scale a video width up to two times 2X, the command will be:įfmpeg -i input.mp4 -vf scale=iw*2:ih output.mp4įfmpeg -i input.jpg -vf scale=iw*2:ih input_double_width.png Avoid Upscaling

You can use variables instead of numbers to specify the width and height of the video file. For example, if the width is kept at 320, the height will be calculated as 206įfmpeg -i input.mp4 -vf scale=320:-1 output.mp4įfmpeg -i input.jpg -vf scale=320:-1 output_320.png Using Variables When one component is set, the remaining component is calculated by the original image’s aspect ratio. The command to resize the video to 320:240 pixels will be:įfmpeg -i input.avi -vf scale=320:240 output.aviįfmpeg -i input.jpg -vf scale=320:240 output_320x240.png Keeping the Aspect Ratio:įor keeping the aspect ratio, you have to specify either width or height and set the other component to -1. Simple RescalingĪ scale filter is used in its most basic form for simply resizing the video to the desired size. In all the examples, we will be taking the input.jpg image with 535 ×346 pixels as a reference to see the final results.
FFMPEG RESIZE IMAGE HOW TO
How To Resize/Scale Videos Using FFmpeg?įollowing are the various tasks with all their steps to resize/scale your video file with FFmpeg. FFmpeg is a leading tool for changing media files to your required format, extracting audios, creating GIFs, scale, crop and edit the videos, and many more. Part 2: How to Resize/ Scale Your Videos in FFmpeg Easily ?ĭuring video editing, processing, and compression, one has to resize or scale the video many times to meet the final requirements. With a single tool capable of doing so much, we will guide you on how can you use it to resize/scale your video files? So stay tuned. A lot of media-related projects rely entirely on this fantastic tool for audio-video tasks. FFmpeg is also among those tools and the first choice for experienced users because of its high quality and quick results. You can find multiple open source tools for editing or converting your multimedia files into what you need.
