mirror of
https://github.com/skoobasteeve/useful-scripts.git
synced 2026-03-20 07:28:57 +00:00
merge?
This commit is contained in:
2
README.md
Normal file
2
README.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Ray's Useful Scripts
|
||||||
|
A collection of scripts that have helped me at home and in the office.
|
||||||
@@ -94,8 +94,23 @@ else
|
|||||||
error_exit "$LINENO: Not a valid source" 1>&2
|
error_exit "$LINENO: Not a valid source" 1>&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
echo "File(s) encoded successfully!"
|
echo "File(s) encoded successfully!"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
=======
|
||||||
|
# Encode each file in the directory with different CRF setting based on resolution
|
||||||
|
for FILE in "$DIRECTORY"/*.*; do
|
||||||
|
RES=$(ffprobe -v error -select_streams v:0 -show_entries stream=width -of default=noprint_wrappers=1:nokey=1 "$FILE")
|
||||||
|
FILENAME=$(basename "$FILE")
|
||||||
|
if [[ $RES -gt 1920 ]]; then
|
||||||
|
ffmpeg -i "$FILE" -c:v libx264 -preset slow -tune film -crf "$QUALITY_4K" -c:a copy "$DIRECTORY"/output/"$FILENAME"
|
||||||
|
elif [[ $RES -le 1920 ]]; then
|
||||||
|
ffmpeg -i "$FILE" -c:v libx264 -preset slow -tune film -crf "$QUALITY_HD" -c:a copy "$DIRECTORY"/output/"$FILENAME"
|
||||||
|
else
|
||||||
|
echo "$FILENAME is not a valid filetype"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
>>>>>>> main
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user