3

I try to reduce the dimensions of video:

ffmpeg -i input.mp4 -y -acodec aac -ac 2 -ab 160k -vcodec libx264 -vf "scale=-1:'min(720,ih)'" -f mp4 output.mp4

I got :

width not divisible by 2 (405x720)

I tried with:

 -vf "scale=-1:'min(720,ceil(ih/2)*2)'"

Go the same because I need to keep width propotions

Any idea ?

I already read that without success:

FFMPEG (libx264) "height not divisible by 2"

yarek
  • 10,010
  • 26
  • 106
  • 195

1 Answers1

6

Use

scale='bitand(oh*dar,65534)':'min(720,ih)'

This will rescale the width proportional to the output height and then reduce it an even value.

Gyan
  • 74,575
  • 7
  • 138
  • 171
  • 3
    Can you please explain what `65534` is? My current command for scaling is `scale=999:trunc(ow/a/2)*2,overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2` – ClassA Jul 17 '20 at 14:12
  • 1
    I have asked a question, can you please have a look - https://stackoverflow.com/questions/62955932/ffmpeg-width-not-divisible-by-2 – ClassA Jul 17 '20 at 14:19