Created
March 15, 2023 13:34
-
-
Save syuhendar729/ce85965cb42f2c8680df4c9cbc7b150d to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# folder tempat file berada | |
folder_path="." | |
# loop melalui setiap file dalam folder | |
for input_file in "$folder_path"/*.MOV | |
do | |
# cek apakah file merupakan file video dengan ekstensi .MOV | |
if [[ -f "$input_file" ]] && [[ "${input_file##*.}" == "MOV" ]]; then | |
output_file="${input_file%.*}_compr.MOV" | |
# cek apakah folder sudah ada file tersebut | |
if [[ -f "compr/$output_file" ]]; then | |
echo "File sudah ada di dalam folder." | |
else | |
# menjalankan perintah ffmpeg untuk mengonversi file | |
ffmpeg -i "$input_file" -vcodec libx265 -crf 28 "compr/$output_file" | |
fi | |
fi | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment