Skip to main content
replaced http://superuser.com/ with https://superuser.com/
Source Link

What I am trying to do is set up one script that will check the ratio of height over width and then determine WHICH dimension to scale to fit HD(1920x1080). Is this possible using standard FFMPEG commands?

I also need to crop either height or width if the resulting dimension is larger than 1080 or 1920 respectively.

I've already read this Resize videos with different widths to a fixed height preserving aspect ratio with ffmpegResize videos with different widths to a fixed height preserving aspect ratio with ffmpeg

so i know how to scale if you know in advance WHICH dimension of your source video is larger.

What I am trying to do is set up one script that will check the ratio of height over width and then determine WHICH dimension to scale to fit HD(1920x1080). Is this possible using standard FFMPEG commands?

I also need to crop either height or width if the resulting dimension is larger than 1080 or 1920 respectively.

I've already read this Resize videos with different widths to a fixed height preserving aspect ratio with ffmpeg

so i know how to scale if you know in advance WHICH dimension of your source video is larger.

What I am trying to do is set up one script that will check the ratio of height over width and then determine WHICH dimension to scale to fit HD(1920x1080). Is this possible using standard FFMPEG commands?

I also need to crop either height or width if the resulting dimension is larger than 1080 or 1920 respectively.

I've already read this Resize videos with different widths to a fixed height preserving aspect ratio with ffmpeg

so i know how to scale if you know in advance WHICH dimension of your source video is larger.

Post Closed as "Duplicate" by slhck
Source Link
Bachalo
  • 2.7k
  • 15
  • 50
  • 61

FFMPEG and input video-any way to retrieve height & width dynamically?

What I am trying to do is set up one script that will check the ratio of height over width and then determine WHICH dimension to scale to fit HD(1920x1080). Is this possible using standard FFMPEG commands?

I also need to crop either height or width if the resulting dimension is larger than 1080 or 1920 respectively.

I've already read this Resize videos with different widths to a fixed height preserving aspect ratio with ffmpeg

so i know how to scale if you know in advance WHICH dimension of your source video is larger.