Ffmpeg video scale fails on MacOS with No such filter

I am trying to scale down a video to some maximum width and height. I am using the command

ffmpeg -i /Users/semyon/FindomClub/Resources/VIDEO/545 -ss 00:00:00 -t 30 -vf 'scale=if(gte(iw\,ih)\,min(1280\,iw)\,-2):if(lt(iw\,ih)\,min(720\,ih)\,-2)' -c:a copy /Users/semyon/FindomClub/Resources/temp/e20a8cb5-cc64-43a7-b850-95d350c0c637.mp4

And it fails with:

[AVFilterGraph @ 0x6000014e4960] No such filter: 'scale=if(gte(iw\,ih)\,min(1280\,iw)\,-2):if(lt(iw\,ih)\,min(720\,ih)\,-2)'

Read more here: Source link