Created
July 17, 2019 03:48
-
-
Save hr3lxphr6j/827060b7f0ceedad829da11694dcbccc 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 | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
_main() { | |
path=$1 | |
for file in $(find $path -name '*.flv' -cmin +1); do | |
if [[ $(wc -c "${file}" | awk '{print $1}') -lt $(expr 10 '*' 1024 '*' 1024) ]]; then | |
echo "INFO: video file less than 10mb, del it (${file})" && rm -rf "${file}" | |
continue | |
fi | |
ffmpeg -hide_banner -i "${file}" -c copy "${file/%.flv/.mp4}" && rm -rf "${file}" | |
done | |
} | |
main() { | |
oldifs=$IFS | |
IFS=$'\n' | |
_main ${1:-$(pwd)} | |
IFS=$oldifs | |
} | |
main $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment