Last active
October 6, 2021 04:19
-
-
Save rizkysyazuli/b1333d20c3cff5e065ed to your computer and use it in GitHub Desktop.
[Shell - Media] Batch edit image or video #shell #ffmpeg #snippets
This file contains hidden or 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
#!/bin/bash | |
IMAGES=~/Images | |
find "$IMAGES" -name '*.TIF' -exec sh -c 'convert "$0" -resize 1024x768 "${0%%.tif}_1024.jpg"' {} \; | |
# for debug | |
# find "$IMAGES" -name '*.TIF' -exec sh -c 'echo "${0%%.tif}_1024.jpg"' {} \; | |
exit; |
This file contains hidden or 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
#!/bin/bash | |
MOVIES=~/Movies | |
find "$MOVIES" -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -codec:v libx264 -preset medium -movflags faststart -vf scale=640:-1,format=yuv420p "${0%%.mp4}_640.mp4"' {} \; | |
# for debugging | |
# find "$MOVIES" -name '*.mp4' -exec sh -c 'echo "${0%%.mp4}_640.mp4"' {} \; | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment