I run the following bash script to rotate my mobile phone vids
while read filename ; do
    nf=$(echo $filename |rev | cut -f1 -d '/'|cut -f2- -d '.' |rev)
    echo $nf
    rm -f ffmpeg2pass-0.log
    rm -f rotate/tmp.avi
    ffmpeg -i $filename -c:v libxvid -pass 1 -c:a libmp3lame -qscale:a 4 -vf "transpose=2,transpose=2" "rotate/tmp.avi"
    ffmpeg -i $filename -c:v libxvid -pass 2 -c:a libmp3lame -qscale:a 4 -vf "transpose=2,transpose=2" "rotate/$nf.avi"
done <rotatelist_2
I know there are better ways to do this; I budged this together but I'm figuring out how to do the videos right so the rest don't need to look nice ;-))
However after the first run, the loop unexpectedly ends with no error message. I run similar loops for other things which work pretty well.
The echo is not called again so I guess there's something wrong with the loop itself. The linebreak in the list is a 0x0A, so it should be ok.
 
     
    