I use this filter to do some cropping:
which works alright. The problem is that sometimes, I do not know what is the input that I am going to get. It might be a
1000x500 or a
500x1000, for instance. So when that happens it just gets a small area of the center of the video. The ideal would be to resize the input to match the smaller of its dimensions to my desired output, and crop the rest. The problem is that I do not know which dimension is going to be.
How could I build a filter to solve this problem?