I hate movies recorded on phone in vertical position. This just short tip how I dealt with with it last time:

for m in *.mp4
do
    avconv -i $m -vf "transpose=1" -codec:a copy -codec:v libx264 -preset slow -crf 23 rotated-$m
done

Other examples:
http://stackoverflow.com/questions/3937387/rotating-videos-with-ffmpegexternal link
http://superuser.com/questions/578321/how-to-flip-a-video-180external link °-vertical-upside-down-with-ffmpeg