Hello Readers,
FFmpeg has an extremely effective level filtration system, which usually can be used to completed the various tasks. A lot of them are listed here. You more can be found in the FFmpeg official documentation. In all the following examples, the particular starting image (input. jpg) is going to be this (535x346 pixels):
In order to basically resize your current video to your specific size (e.g 320x240), you should use the scale filter in its most basic form:
ffmpeg -i input.avi -vf scale=320:240 output.avi
You can use same command for images too:
ffmpeg -i input.jpg -vf scale=320:240 output_320x240.png
Usually, if you resize any video/image to fixed height and width, then the output image may be starched or appears starched.
For getting the perfection in the resized image we need to specify only one component, either width or height, and set the other component to -1. For example, see below command line:
ffmpeg -i input.jpg -vf scale=320:-1 output_320.png <!-- aspect ratio according width -->
Likewise if you want to resize your video/image in aspect ratio of height, you can use following command.
ffmpeg -i input.jpg -vf scale=-1:-240 output_240.png <!-- aspect ratio according height -->
Here are few useful commands which can be used instead of number, to specify height and width of the getting output image.
A simple example: If you want image width just double from its actual width, you can use the below command for the same:
ffmpeg -i input.jpg -vf scale=iw*2:ih input_double_width.png
in above command:
iw = input width constant
ih = input height constant
iw and ih both are the codac of FFmpeg command tool
Thanks
0 Comment(s)