Is there any way to tell ffmpeg to preserve the aspect ratio when resizing a video by adding padding in the shorter dimension? I know that I can do it by manually adding the proper amount of padding, but I am converting many videos of arbitrary sizes, and I cannot do each one manually. I read somewhere that the -s option used to do this, but it does not any more. To clarify, I am not looking to fix the height and let the width be whatever it needs to be to preserve the ratio (as I have seen in other questions).
-
By "adding padding", you mean pillar- or letterboxing?– slhckMay 12, 2012 at 17:53
-
@slhck: Yes, I do.– user130039May 12, 2012 at 18:12
-
Do you want a fixed width?– lloganMay 13, 2012 at 3:19
-
@LordNeckbeard: I want to fix the width and the height but have it pillar- or letterboxed to preserve the aspect ratio.– user130039May 13, 2012 at 11:36
Add a comment
|
1 Answer
Is there any way to preserve the aspect ratio when resizing a video by adding padding in the shorter dimension?
ffmpeg -i 01.jpg -vf scale=-1:360,pad=640:ih:(ow-iw)/2 -qmax 1 360-01.jpg
I havent used this command in a while so YMMV.