Last active
November 3, 2022 01:27
-
-
Save curiousercreative/b66314a6b89f913dca94ac1b334338dc to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
askYesNo() { | |
local answer= | |
while [ "$answer" != "y" ] && [ "$answer" != "n" ]; do | |
read -e -n 1 -p "$1 (y/n) " answer | |
done | |
if [ "$answer" != "y" ]; then | |
return 1 | |
fi | |
} | |
transcode() { | |
for i in *.mov; do | |
if [ -e "$i" ]; then | |
ffmpeg -i "$i" -c:v copy -c:a pcm_s16le "${i%.mov}-pcm.mov" | |
fi | |
done | |
for i in *.mp4; do | |
if [ -e "$i" ]; then | |
ffmpeg -i "$i" -c:v copy -c:a pcm_s16le "${i%.mp4}-pcm.mov" | |
fi | |
done | |
} | |
cd "$1" | |
ls -1 *.mov 2> /dev/null | |
ls -1 *.mp4 2> /dev/null | |
if askYesNo "Transcode AAC audio to Linear PCM audio and rewrap as .mov for the above files?"; then | |
transcode | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
updated: