Naposledy aktivní 1 day ago

curiouser's Avatar Winston Hoy revidoval tento gist 3 years ago. Přejít na revizi

1 file changed, 17 insertions, 2 deletions

pcmify.sh

@@ -10,9 +10,24 @@ askYesNo() {
10 10 fi
11 11 }
12 12
13 + transcode() {
14 + for i in *.mov; do
15 + if [ -e "$i" ]; then
16 + ffmpeg -i "$i" -c:v copy -c:a pcm_s16le "${i%.mov}-pcm.mov"
17 + fi
18 + done
19 +
20 + for i in *.mp4; do
21 + if [ -e "$i" ]; then
22 + ffmpeg -i "$i" -c:v copy -c:a pcm_s16le "${i%.mp4}-pcm.mov"
23 + fi
24 + done
25 + }
26 +
13 27 cd "$1"
14 - ls -1 *.{mov,mp4}
28 + ls -1 *.mov 2> /dev/null
29 + ls -1 *.mp4 2> /dev/null
15 30
16 31 if askYesNo "Transcode AAC audio to Linear PCM audio and rewrap as .mov for the above files?"; then
17 - for i in *.{mov,mp4}; do ffmpeg -i "$i" -c:v copy -c:a pcm_s16le "${i%.m}-pcm.mov"; done
32 + transcode
18 33 fi

curiouser's Avatar Winston Hoy revidoval tento gist 3 years ago. Přejít na revizi

1 file changed, 1 insertion, 1 deletion

pcmify.sh

@@ -13,6 +13,6 @@ askYesNo() {
13 13 cd "$1"
14 14 ls -1 *.{mov,mp4}
15 15
16 - if askYesNo "Transcode AAC audio to Linear PCM audio and rewrap as .mp4 for the above files?"; then
16 + if askYesNo "Transcode AAC audio to Linear PCM audio and rewrap as .mov for the above files?"; then
17 17 for i in *.{mov,mp4}; do ffmpeg -i "$i" -c:v copy -c:a pcm_s16le "${i%.m}-pcm.mov"; done
18 18 fi

curiouser's Avatar Winston Hoy revidoval tento gist 3 years ago. Přejít na revizi

1 file changed, 4 insertions, 4 deletions

pcmify.sh

@@ -11,8 +11,8 @@ askYesNo() {
11 11 }
12 12
13 13 cd "$1"
14 - ls *.mp4
14 + ls -1 *.{mov,mp4}
15 15
16 - if askYesNo "Transcode AAC audio to Linear PCM audio and rewrap as .mov for the above files?"; then
17 - for i in *.mp4; do ffmpeg -i "$i" -c:v copy -c:a pcm_s16le "${i%.mp4}.mov"; done
18 - fi
16 + if askYesNo "Transcode AAC audio to Linear PCM audio and rewrap as .mp4 for the above files?"; then
17 + for i in *.{mov,mp4}; do ffmpeg -i "$i" -c:v copy -c:a pcm_s16le "${i%.m}-pcm.mov"; done
18 + fi

curiouser's Avatar Winston Hoy revidoval tento gist 4 years ago. Přejít na revizi

1 file changed, 18 insertions

pcmify.sh(vytvořil soubor)

@@ -0,0 +1,18 @@
1 + #! /bin/bash
2 + askYesNo() {
3 + local answer=
4 + while [ "$answer" != "y" ] && [ "$answer" != "n" ]; do
5 + read -e -n 1 -p "$1 (y/n) " answer
6 + done
7 +
8 + if [ "$answer" != "y" ]; then
9 + return 1
10 + fi
11 + }
12 +
13 + cd "$1"
14 + ls *.mp4
15 +
16 + if askYesNo "Transcode AAC audio to Linear PCM audio and rewrap as .mov for the above files?"; then
17 + for i in *.mp4; do ffmpeg -i "$i" -c:v copy -c:a pcm_s16le "${i%.mp4}.mov"; done
18 + fi
Novější Starší