Mint Serena 64 bit using the Mate desktop environment. Most of the following scripts will run on this machine, although some have only been tested with the Gnome desktop. Extra software requirements can be met by the Ubuntu and safe PPA repositories. Scripts may be re-written or added to from time to time, the date serves as the version number. Syntax highlighting on these pages is provided by GVim's "Convert to HTML" option.

DVD Audio Rip


#!/bin/bash
# Filename: dvd-audio-rip.sh
# Version: 160612
# Author: robz
# This script will rip the audio tracks off of a "concert dvd" to multiple mp3
# files named Track 01, Track 02, etc. You then have options listen to them on
# yer iPod, in your car or burn them to a cd. Quality of the rip depends on the
# option switch "--lame_preset", see "man transcode" for other presets.
# You may need to alter the "DRIVE" variable to suit, you'll also need packages
# "transcode" and "lsdvd" to be installed.
# Usage: Double click the script and select "Run in Terminal", Ctrl+c to stop.

trap "killall transcode; exit" INT TERM EXIT      # Terminate this script.
mkdir -p new-audio; cd new-audio                  # Make a dir. for the mp3s.

DRIVE="/dev/sr0"                                  # Path to your dvd drive.
TITLE=$(lsdvd -a "$DRIVE" | awk '/Longest track/ {print$3}')
CHPTR=$(lsdvd -a -t"$TITLE" "$DRIVE" | awk '/Chapters/ {print $6}')
ASTRM="0"                                         # Audio stream (0=pcm 1=ac3).

for TRACK in $(eval echo "{1..${CHPTR%,*}}")      # Loop through the chapters.
do
    transcode\
    -i /dev/sr0\
    -x null,dvd\
    -T "$TITLE","$TRACK",1\
    -a "$ASTRM"\
    -y null,tcaud\
    --lame_preset extreme\
    -m "Track "$(printf "%02d" "$TRACK").mp3
done                                              # Files are on the desktop.
 


No comments: