User Tools

Site Tools


ffprobe:video:rotate

This is an old revision of the document!


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

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

With Grep

ffprobe somevideo.mp4 2>&1 | grep rotate

returns:

rotate          : 90
ffprobe/video/rotate.1736762687.txt.gz · Last modified: 2025/01/13 10:04 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki