Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question
    
By "adding padding", you mean pillar- or letterboxing? – slhck May 12 '12 at 17:53
    
@slhck: Yes, I do. – user130039 May 12 '12 at 18:12
    
Do you want a fixed width? – LordNeckbeard May 13 '12 at 3:19
    
@LordNeckbeard: I want to fix the width and the height but have it pillar- or letterboxed to preserve the aspect ratio. – user130039 May 13 '12 at 11:36

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.

FFmpeg slideshow

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.