Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
is it possible using if/else statement in ffmpeg ?
I would want to tell ffmpeg if dimension of any video lower than 480p do not touch the height or width otherwise do encode and resize it to 480p, here's my command but it always scale up the video if the video lower than 480p
ffmpeg -i input.mp4 -c:v libx264 -crf 31 -me_method umh -bf 0 -vf scale=480:-2 out.mp4
Note that i dont want to use any programming language because it's on windows cmd.
–
ffmpeg -i input.mp4 -c:v libx264 -crf 31 -me_method umh -bf 0 -vf scale='if(gte(ih\,480)\,480\,iw)':-2 out.mp4
This will rescale videos whose height is 480 or more.
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.