Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Resize A Video With FFmpeg


This is the FFmpeg command I use to resize videos :

NOTE : If audio doesn't copy try adding [TODO: Code shorthand span ]

ffmpeg -i "in.mp4" -vf "scale=720:-2" "out.mp4"

It resizes the in.mp4 video to a 720 pixel wide version called out.mp4 . The height is determined automatically.


Resizing videos with FFmpeg by adding this to the command :

-vf "scale:WIDTH:HEIGHT"

The WIDTH and HEIGHT can be set to arbitrary values. That includes values that don't match the original aspect ratio which would result in distorted output.

Using [TODO: Code shorthand span ] on one of the dimensions automatically resizes it to fit the aspect ratio. For example, a 3840x2160 source video resized with this :

ffmpeg -i "in.mp4" -vf "scale=1920:-2" "out.mp4"

produces a video that's 1920x1080.

Putting the [TODO: Code shorthand span ] on the HEIGHT works as well. For example, this also produces a 1920x1080 video from a 3840x2160 source.

ffmpeg -i "in.mp4" -vf "scale=-2:1080" "out.mp4"

- It's possible to use [TODO: Code shorthand span ] instead of [TODO: Code shorthand span ] in the examples above, but it's not recommended. Using [TODO: Code shorthand span ] matches the aspect ratio exactly which means it could be an odd number. Some filters can't deal with odd numbers. Using [TODO: Code shorthand span ] ensures the value is even.

[] Link to cropping post - id : 2o4bcmue

[] Link to image quality post - id : 2svphsuw

[] Look at [TODO: Code shorthand span ] which might be for audio and might be necessary

[] Link to resize with padding example - - id : 2sxx0svx

[] Show examples of cropping and resizing

Footnotes And References