I need to detect whether videos are recorded in portrait or landscape mode, then transpose those into the correct orientation, in a scripted fashion.
if [ "$v_orient" == "landscape" ]
then
ffmpeg -i file.mp4 -vf "transpose=1" file.ogv
else
ffmpeg -i file.mp4 file.ogv
fi
I've looked in ffmpeg online documentation and googled around,
I've attempted exiftool
exiftool -Rotation -Rotate file.mp4
However, this outputs Rotate: 90 for both landscape & portrait videos I have.
How can I detect the video orientation in bash?