Why do I get "height not divisible by 2"?
H.264 and HEVC store colour at half resolution in both directions, so they need even widths and heights. -1 keeps the shape exactly and does not round to an even number:
ffmpeg -i in.mp4 -vf scale=1280:-1 out.mp4Fails: [libx264] height not divisible by 2 (1280x545), then Conversion failed!. libx265 fails the same way with its own message. A WebM with VP9 accepted the odd height.
Use -2 instead of -1. It keeps the shape and rounds to the nearest even number: 545.33 became 546. Any -n works the same way, so -4 or -16 gives a height divisible by 4 or 16.
When you size with force_original_aspect_ratio, there is no -2 to write. Add force_divisible_by=2 to the same filter.





