When I updated to Ubuntu 9.10 Karmic Koala, the script posted earlier in this thread suddenly stopped working. I was getting errors such as:
[export_raw.so] warning: Usage of this module for audio encoding is deprecated.
[export_raw.so] warning: Consider switch to export_tcaud module.
[transcode] Audio: using lame-3.98.2
[avilib.c] avi open error: avilib - Error opening AVI file
REASON: Bad address
I eventually fixed it by changing the import option to dvd,dvd instead of dvd and the export to null,tcaud instead of raw. From what I understand, transcode has changed how things are interpreted from the command line, so that the import and export options refer to the video codec, then the audio codec, separated by a comma. If you only have one listed, instead of two separated by a comma, it interprets it as a video codec, and won't accept an audio-only codec such as lame.
I also figured out how to modify the script so that it used my second dvd drive. It involves replacing two lines.
Replace
Code:
lsdvd -v /dev/dvd | grep 'Length:' | cut -d, -f1,2
with
Code:
lsdvd -v /dev/dvd1 | grep 'Length:' | cut -d, -f1,2
and replace
Code:
export src=/media/cdrom0
with
Code:
export src=/media/cdrom1
Here is the modified script. It uses the first DVD drive in the system, since most people only have one. If you have two, and want to use the second one, then make the changes described above.
Code:
#!/bin/bash
# DVD Audio ripping script originally created
# by supertux from the Ubuntu forums:
# http://ubuntuforums.org/showpost.php?p=4251034&postcount=12
# Modified by NTolerance to list DVD information,
# accept command line arguments, and output 256kbit MP3 files.
# Modified by strangeattractor to pad zeros in the file name
# and to use tcaud instead of raw for exporting
# Requires installation of transcode, lsdvd, and lame packages from the
# Ubuntu repositories and probably other packages related to DVD
# decryption and playback.
# usage: dvd-audio-rip.sh [Title] [TotalTracks]
# example: dvd-audio-rip.sh 04 06
# Running without Title or TotalTracks arguments will
# display DVD track information.
case "$1" in
"") echo "DVD Title and Track Information:"
echo
lsdvd -v /dev/dvd | grep 'Length:' | cut -d, -f1,2
echo
echo "usage: dvd-audio-rip.sh [Title] [TotalTracks]"
echo "example: dvd-audio-rip.sh 04 06"
exit $E_PARAM
;;
*) export title=$1
export totaltracks=$2
export src=/media/cdrom0
export tracks=1
until [ $tracks -gt $totaltracks ]; do
transcode -i $src -x dvd,dvd -T $title,$tracks,1 -a 0 -y null,tcaud -b 256 -m `printf "%02d" $title`-track-`printf "%03d" $tracks`.mp3
let tracks+=1
done
;;
esac
Bookmarks