ffprobe:video:rotate
This is an old revision of the document!
Table of Contents
ffprobe - Video - Rotate
To detect whether videos are recorded in portrait or landscape mode.
Video orientation detection
ffprobe -v error -select_streams v:0 -show_entries stream_tags=rotate -of csv=s=x:p=0 input.mp4
NOTE: On unrotated videos, the above command produces no output.
With Grep
ffprobe somevideo.mp4 2>&1 | grep rotate
returns:
rotate : 90
In a Bash Script
rotate=$(ffprobe -v error -select_streams v:0 -show_entries stream_tags=rotate -of csv=s=x:p=0 "${sourceFile}") if [ "$rotate" != "" ]; then echo "We need to rotate: $rotate" fi
ffprobe/video/rotate.1736763134.txt.gz · Last modified: 2025/01/13 10:12 by peter