Last active
March 27, 2022 08:17
-
-
Save viz3/2866481 to your computer and use it in GitHub Desktop.
extract audio from dvd.
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/sh | |
dvd_device="/PATH/TO/VIDEO_TS" | |
# exec mplayer -dvd-device "$dvd_device" dvd:// -identify to acquire chapters and aid. | |
chapters="21" | |
aid="160" | |
title="1" | |
for chapter in `seq 1 $chapters`; do | |
wav=`printf %02d.wav $chapter` | |
if [ ! -e "$wav" ]; then | |
mplayer -dvd-device "$dvd_device" -vo null -chapter "${chapter}-${chapter}" -ao pcm:file=${wav}:fast -aid "$aid" dvd://"$title" | |
fi | |
m4a=`echo $wav | sed -e 's/wav/m4a/'` | |
if [ ! -e "$m4a" ]; then | |
ffmpeg -i $wav -acodec alac $m4a | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment