Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- export FFMPEG_FLAGS='-c:v libsvtav1 -crf 30 -preset 6 -vf scale=trunc(iw/2)*2:trunc(ih/2)*2 -pix_fmt yuv420p -movflags faststart -loop 0'
- while IFS= read -r -d '' file; do
- dir=$(dirname "$file")
- name=$(basename "$file")
- output="${name%.*}.mkv"
- pushd "$dir" > /dev/null || continue
- if [[ -e "$output" ]]; then
- echo "Skipping existing: $output"
- popd > /dev/null
- continue
- fi
- echo "Converting: $file -> $output"
- ffmpeg -nostdin -i "$name" $FFMPEG_FLAGS "$output"
- popd > /dev/null
- done < <(find . -type f -iname "*.gif" -print0)
Advertisement
Add Comment
Please, Sign In to add comment