Best way to batch rotate 3000+ h.264 videos?
Use ffmpeg and the "transpose" filter as "poor" suggested. For example, if your files are mp4 and are in the current directory:

mkdir -p rotated
for f in *.mp4; do ffmpeg -i "$f" -vf transpose=2 -c:a copy -metadata:s:v rotate="" rotated/"$f"; done



The transpose value can be "1" or "clock" for clockwise rotation, "2" or "cclock" for counter-clockwise rotation. There are other values which will also apply a flip.
The audio will be stream copied to avoid unnecessary re-encoding.
The video stream rotation metadata is cleared in this example. Otherwise ffmpeg will copy it from the input to the output resulting in an incorrect rotation for players that pay attention to this metadata (some do, and some don't).


Another example, more verbose and flexible, and which keeps the rotated file in the same directory with a new name:

ext=mp4
for f in /some/dir/*.$ext; do
    new=${f/%.$ext/-rotated.$ext};
    ffmpeg -i "$f" -vf transpose=2 -c:a copy -metadata:s:v rotate="" "$new"
done