thevoipman
thevoipman

Reputation: 1833

ffmpeg auto dection portrait then do the necessary flip

Is it possible to have ffmpeg detect the video size, and if it's not landscape, have it do the rotate to 90 degress clockwise? I have found an article here, but am not sure if it can detect this automatically or not: Rotating videos with FFmpeg

Upvotes: 0

Views: 895

Answers (2)

Xeberdee
Xeberdee

Reputation: 2057

-autorotate

Automatically rotate the video according to file metadata. Enabled by default, use -noautorotate to disable it.

Upvotes: 0

av501
av501

Reputation: 6739

If your decision is based on height and width a very simple script around ffmpeg can do this for you

ffprobe yourfile

In the output you will have height and width parameters available for the stream. Run a regex on it.

Based on height and width take decision in your script to rotate or not

Call ffmpeg with the right parameters.

Upvotes: 1

Related Questions