Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set +e
- reencode() {
- local E=${2##*.}
- ffmpeg -i "$2" -vf scale="-1:'min(ih,720)'" -c:v hevc_nvenc -b:v 1M -c:a aac -b:a 256K -y "$1.$E"
- local newsize=$(stat -c %s "$1.$E")
- local oldsize=$(stat -c %s "$2")
- if [ $newsize -lt $oldsize ]; then
- mv "$1.$E" "$2"
- else
- rm "$1.$E"
- fi
- }
- export -f reencode
- find -size +100M -and \( -iname '*.mkv' -or -iname '*.mp4' \) | parallel -j 4 --progress --eta "reencode {#} {}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement