Created
November 24, 2018 16:56
-
-
Save mcsf/ccbc10a8214a7ececfa627c6755a2a34 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 | |
INPUT="$1" | |
OUTPUT=$(perl -C -Mutf8 -pe 's/\.mp4$/.converted.mp4/i' <<< "$INPUT") | |
YELLOW=$(tput setaf 3) | |
BLUE=$(tput setaf 4) | |
RESET=$(tput sgr0) | |
if [ -a "$OUTPUT" ]; then | |
echo "${YELLOW}Skipping $INPUT: $OUTPUT already exists.${RESET}" | |
else | |
echo "${YELLOW}Converting $INPUT...${RESET}" | |
ffmpeg -i "$INPUT" -acodec aac "$OUTPUT" > /dev/null 2>&1 | |
echo "${BLUE}Finished $OUTPUT${RESET}" | |
fi |
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 | |
GREEN=$(tput setaf 2) | |
RESET=$(tput sgr0) | |
find . -iname '*.mp4' -not -iname '*.converted.*' -print0 | xargs -0 -I % -P 2 any2aac % | |
echo "${GREEN}All done.${RESET}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment