I have a html 5 video player which is 700px wide, 400px high. I'm trying to use `avconv` to use ffmpeg to resize (while retaining the aspect ratio) and making sure it fits into my player.

Input can be a file of any size, so I need to resize the larger ones but center the smaller ones with black bars. So far I've tried: `-s` and `-aspect`, I've seen `pad` being used with the `-vf` switch but don't understand how it works enough to get what I need.

![Images][1]

This is a rough idea of what I need. I'm not sure if it's even possible. It's almost like CSS's max-width/max-height. I realise this may just be a jumble of words but if anyone happens to understand what I'm talking about, I'd appreciate help, Thanks.

avconv command:

`avconv -y -i control.avi -vcodec libx264 -b 2000k -bufsize 20M -acodec aac -strict experimental -ar 44100 -ab 256k bigbuck_out.mp4`



  [1]: https://i.sstatic.net/NRBd5.png