Log in

View Full Version : x264 CLI resize - only specify width?


buffyangel108
11th October 2015, 18:50
Possibly a very daft question, but is there a way to resize in x264 CLI by just specifying the width?

I have a bunch of files in various resolutions and ARs that I'm looking to convert to 720x??? for portable device playback.

e.g.:

1920x1080 (1.77/1) -> 720x400
1280x544 (2.35/1) -> 720x304

Is there a way of doing this in x264 CLI (i.e. determining the height from the input file AR)?

buffyangel108
11th October 2015, 19:07
Ah, seems it was a daft question! After reading x264 --longhelp, this seems to be working so far:

resize:width=720,fittobox=width

Motenai Yoda
11th October 2015, 19:13
If it's ported from mplayer/ffmpeg try with -1 -2 or -4
If one of the values is -1, the scale filter will use a value that maintains the aspect ratio of the input image, calculated from the other specified dimension. If both of them are -1, the input size is used

If one of the values is -n with n > 1, the scale filter will also use a value that maintains the aspect ratio of the input image, calculated from the other specified dimension. After that it will, however, make sure that the calculated dimension is divisible by n and adjust the value if necessary.