Created
June 7, 2023 09:45
-
-
Save michezio/88b2fe6252a1782790cd5fdcbacba4d6 to your computer and use it in GitHub Desktop.
Bulk convert image files from a format to another
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 | |
srcExt=$1 | |
destExt=$2 | |
srcDir=$3 | |
destDir=$4 | |
opts=$5 | |
for filename in "$srcDir"/*.$srcExt; do | |
basePath=${filename%.*} | |
baseName=${basePath##*/} | |
ffmpeg -i "$filename" $opts "$destDir"/"$baseName"."$destExt" | |
done | |
echo "Conversion from ${srcExt} to ${destExt} complete!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment