Created
December 3, 2022 12:17
-
-
Save Shamim-38/1a2d557d9c06163e8f7a302a77d08ecc to your computer and use it in GitHub Desktop.
Resizing_Video.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pretty good solution. One can resize a video as: | |
ffmpeg -i AigCblw--hk_000067_000077.mp4 -vf "scale='if(gt(ih,iw),256,trunc(oh*a/2)*2):if(gt(ih,iw),trunc(ow/a/2)*2,256)'" output.mp4 | |
For multiple videos, one can perform (please mkdir a videos_resized folder in prepath ../): | |
for f in *.mp4 ; do ffmpeg -i "$f" -vf "scale='if(gt(ih,iw),256,trunc(oh*a/2)*2):if(gt(ih,iw),trunc(ow/a/2)*2,256)'" "../videos_resized/$f" ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment