For the resolutions, what did you have in mind in terms of bounding boxes for the various qualities? Maximum width; maximum height; or enforce maximum on both (don't like this one..)?
Your code is setting a certain width, and changing the height based on aspect ratio. Anri does the inverse: sets the height and width depends. I think it will be a lot easier doing it this way, especially when you start getting into x264 SAR which will affect width and not height.
Your code is setting a certain width, and changing the height based on aspect ratio. Anri does the inverse: sets the height and width depends. I think it will be a lot easier doing it this way, especially when you start getting into x264 SAR which will affect width and not height.