Howto Use HandBrakeCLI to Rotate a video

To rotate 90° (clockwise)
HandBrakeCLI -i source -o target.m4v --preset="Universal" --rotate="4"

To rotate 270°(anticlockwise)
HandBrakeCLI -i source -o target.m4v --preset="Universal" --rotate="7"

Note:
4 : 90 degrees rotate (clockwise)
7 : 270 degrees rotate (anticlockwise)