Scaling video with FFmpeg can be done with defined width and height like:
ffmpeg -i input.mp4 -vf scale=1920x1080 output_1080p.mp4
Assuming that my video is 16:9 ratio like 1280×720.
However if you didn’t have a conventional ratio like 16:9 and didn’t know the upscaled and down scaled sizes for your videos ratio there is a simple command to do that work for you.
To upscale double of what your original video is
ffmpeg -i input.mp4 -vf scale=iw*2:ih*2 output_double.mp4
iw*2is width x 2, ih*2 means height x 2. You can also times by 3, 4 etc for a bigger size.
Down scaling whilst respecting the ratio is done like:
ffmpeg -i input.mp4 -vf scale=iw*.5:ih*.5 output_half.mp4
This is multiplying by .5 to get half. Another method is to divide by 2
iw/2:ih/2
These scaling methods are quick and do auto calculation on width x height based on the original video ratio.
A drained and empty Kennington reservoir images from a drone in early July 2024. The…
Merrimu Reservoir from drone. Click images to view larger.
Using FTP and PHP to get an array of file details such as size and…
Creating and using Laravel form requests to create cleaner code, separation and reusability for your…
Improving the default Laravel login and register views in such a simple manner but making…
Laravel validation for checking if a field value exists in the database. The validation rule…