Use [0:v]scale='if(gt(a,4/3),-1,320)':'if(gt(a,4/3),240,-1)',setsar=1,crop=320:240[v0c] The scale filter expressions for x and y check the aspect ratio of the input and if greater than 4:3, set the value to the 2nd argument, and if not, to the third argument.