For this, I use a little script and HandBrakeCLI.
Attention, the "-rotate" parameter has changed using HandBrake 1.0, this will work with 1.0.7:
for i in *.mp4 do r=$(exiftool -Rotation $i | cut -d ":" -f2 | sed 's/^[ ]*//') HandBrakeCLI -i $i -o ./out/$i --rotate=angle=$r -e x264 -q 21 -X 1000 done
source share