From: Alan J. Pippin Date: Wed, 20 May 2009 19:49:24 +0000 (-0600) Subject: Moved configuration variables into their own rip_dvd.conf.dist file. X-Git-Tag: 1_0~26 X-Git-Url: http://git.pippins.net/embedvideo/.git/static/images/%7Badd%7D?a=commitdiff_plain;h=a0392e5f7d75539a0a6831d88fda15c821507dae;p=rip_dvd%2F.git Moved configuration variables into their own rip_dvd.conf.dist file. Changed rip_dvd and rip_dvd.wrap to take advantage of this. Introduced concept of a local config file rip_dvd.conf that a user can create, that isn't tracked by GIT, to override the defaults. --- diff --git a/README b/README index 3c4ef21..84d53a5 100644 --- a/README +++ b/README @@ -1,3 +1,6 @@ +---------------------------------------------- +INSTALL +---------------------------------------------- The following steps should be followed to pull this code project into a local GIT repository (local directory): @@ -8,3 +11,15 @@ To pull updates in the future of this project into your local directory: > cd rip_dvd > git pull origin +---------------------------------------------- +CONFIGURATION +---------------------------------------------- +You'll need to copy the rip_dvd.conf.dist file to a local copy of the +file called rip_dvd.conf. This way, you can customize the settings +needed by the script in a file that isn't tracked by GIT. The conf +file tracked by GIT (rip_dvd.conf.dist) will then contain the defaults +the script needs to run. You can override these in your own rip_dvd.conf +file you create locally. This will allow you to get updates from my +GIT repository at a later point in time without blowing away your +local settings. + diff --git a/rip_dvd b/rip_dvd index 5d9f856..3e6d505 100755 --- a/rip_dvd +++ b/rip_dvd @@ -15,58 +15,27 @@ # Known Issues/Limitations: # - Mirror mode is always done in ISO mode # -# Package Dependencies: -# lsdvd dvdauthor gddrescue dvdbackup makexml tovid mencoder vlc mplayer genisoimage +# Package Dependencies (apt-get install these for example): +# lsdvd dvdauthor gddrescue dvdbackup tovid mencoder mplayer genisoimage libdvdcss2 +# +# Specific Executable (program) Dependencies (must be found in $PATH): +# volname makexml lsdvd dvdauthor gddrescue dvdbackup mencoder mplayer mkisofs # # Optional Dependencies: # lookup imdb info/posters for mythvideo: http://www.mythtv.org/wiki/Fill_mythvideo_metadata.pl # -############################################### -# Local Machine Settings - EDIT THIS SECTION - -# Specify the device path to the DVD drive -dev=/dev/dvd2 - -# Specify the path to the log directory -logdir=/var/log/ripdvd - -# Specify the path to the tmp rip directory -tmpdir=/myth/video/DVDs/.ripdvd - -# Specify the email address to send job notifications to -mailto=ajp@pippins.net - -# Setup the path to the tools needed by this ripper -PATH=/etc/mythtv/bin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin:.:$PATH - -# Use mplayer dumpstream to create the main VOB file -# If set to 0, cat and other utils will be used to make it instead. -# Using mplayer dumpstream is by far the best way to create the main VOB file -# The only thing this doesn't work for are DVDs with the 99 title copy protection. -# The script will autodetect these types of disks, and change this to 0 if necessary. -# If this is set to 0, other methods will be employed to get the DVD VOB dump. -use_mplayer_dumpstream=1 - -# 2-channel AVI encoding audio bit rate -audio_bitrate=224 - -# If set to 1, this script will call another script to fill in the mythvideo metadata -# If you don't use mythtv, set this option to 0. If you use mythtv, and have downloaded -# the fill_mythvideo_metadata.pl script shown above, you can leave this option set to 1. -fill_mythvideo_metadata=1 - -# If the 99 titleset copy protection scheme is detected, trust the autodetection or abort. -# The autodetection may work, but it probably won't in this case. Set to 0 by default. -# Override to 1 if you want the script to wing it, and hope it picks the right feature title. -# Otherwise, you will need to rerun the script providing the feature title with the -t option. -trust_feature_title_autodetect_when_uncertain=0 - -# specify the number of threads that mencoder should use when encoding the video (AVI mode) -# an optimal setting for this should be the number of cores you have times 2 -# note: you have to have an mplayer version that has been compiled with multi thread support. -# if you don't, this will have no effect, but won't hurt anything to have it set otherwise. -mencoder_threads=8 +############################################################################## +# Local Machine Settings: +# Sources both the "default" conf file tracked by GIT (rip_dvd.conf.dist) +# and the local conf file created by each local machine (rip_dvd.conf) +# Copy the rip_dvd.conf.dist file to rip_dvd.conf and edit the later. +# This will allow you to override all the default values to meet your needs +# in a way that won't get clobbered when you pull updates from my GIT repo. +############################################################################## +config="${0%/*}/rip_dvd.conf" +[ -e "${config}.dist" ] && . ${config}.dist +[ -e "${config}" ] && . ${config} ############################################### # Command line processing @@ -718,6 +687,7 @@ function check_for_mplayer_dumpstream_incompatibility { if [ $trust_feature_title_autodetect_when_uncertain -eq 0 ]; then echo "-E- Unable to determine the feature title due to the 99 title copy protection scheme" | tee -a "$logfile" echo " You will need to determine this yourself and rerun the script with the -t option" | tee -a "$logfile" + echo " You can google this DVD to find out what it's feature title is, or you can play it in a conventional DVD player to find it." | tee -a "$logfile" invalid_feature_title=1 else echo " Falling back to non mplayer dumpstream methods to copy the DVD" | tee -a "$logfile" diff --git a/rip_dvd.conf.dist b/rip_dvd.conf.dist new file mode 100644 index 0000000..e03d86e --- /dev/null +++ b/rip_dvd.conf.dist @@ -0,0 +1,54 @@ +########################################################################################### +# configuration file for the rip_dvd script: +# - rip_dvd.conf.dist = contains default values (tracked by GIT) +# - rip_dvd.conf = contains localized overrides to the default values (not tracked by GIT) +# should initially be created by copying the rip_dvd.conf.dist +########################################################################################### + +# specify the path to the rip_dvd script +ripcmd="/myth/video/bin/rip_dvd" + +# Specify the device path to the DVD drive +dev=/dev/dvd2 + +# Specify the path to the log directory +logdir=/var/log/ripdvd + +# Specify the path to the tmp rip directory +tmpdir=/myth/video/DVDs/.ripdvd + +# Specify the email address to send job notifications to +mailto=root + +# Setup the path to the tools needed by this ripper +PATH=/etc/mythtv/bin:/usr/local/bin:/usr/sbin:/sbin:/usr/bin:.:$PATH + +# Use mplayer dumpstream to create the main VOB file +# If set to 0, cat and other utils will be used to make it instead. +# Using mplayer dumpstream is by far the best way to create the main VOB file +# The only thing this doesn't work for are DVDs with the 99 title copy protection. +# The script will autodetect these types of disks, and change this to 0 if necessary. +# If this is set to 0, other methods will be employed to get the DVD VOB dump. +use_mplayer_dumpstream=1 + +# 2-channel AVI encoding audio bit rate +audio_bitrate=224 + +# If set to 1, this script will call another script to fill in the mythvideo metadata +# If you don't use mythtv, set this option to 0. If you use mythtv, and have downloaded +# the fill_mythvideo_metadata.pl script shown above, you can leave this option set to 1. +fill_mythvideo_metadata=0 + +# If the 99 titleset copy protection scheme is detected, trust the autodetection or abort. +# The autodetection may work, but it probably won't in this case. Set to 0 by default. +# Override to 1 if you want the script to wing it, and hope it picks the right feature title. +# Otherwise, you will need to rerun the script providing the feature title with the -t option. +trust_feature_title_autodetect_when_uncertain=0 + +# specify the number of threads that mencoder should use when encoding the video (AVI mode) +# an optimal setting for this should be the number of cores you have times 2 +# note: you have to have an mplayer version that has been compiled with multi thread support. +# if you don't, this will have no effect, but won't hurt anything to have it set otherwise. +mencoder_threads=4 + +########################################################################################### \ No newline at end of file diff --git a/rip_dvd.wrap b/rip_dvd.wrap index 0b9825f..bb8093c 100755 --- a/rip_dvd.wrap +++ b/rip_dvd.wrap @@ -1,6 +1,8 @@ #!/bin/bash ############################################## +# COMMAND LINE PROCESSING + # get the dvdtype from the command line dvdtype=$1 @@ -8,25 +10,20 @@ dvdtype=$1 # of the args to be passed directly to the rip_dvd script. shift 1 -# specify the device path to your DVD drive -dev=/dev/dvd2 - -# specify the path to the rip_dvd script -ripcmd="/myth/video/bin/rip_dvd" - -# get the name of the DVD from the DVD disk -dvdname=`volname $dev | awk '{ print $1 }'` -dvdname=${dvdname%.} # remove trailing '.' character - ############################################## if [ -z "$dvdtype" ]; then echo "-E- $0 ' is a required option" usage fi +############################################## +# get the name of the DVD from the DVD disk +dvdname=`volname $dev | awk '{ print $1 }'` +dvdname=${dvdname%.} # remove trailing '.' character + ############################################## # Find out what type of DVD we are ripping -# And set our destination directory appropriatel +# And set our destination directory appropriately # dvdtype parameter: # - netflix = DVD ripped as an entire ISO image # since these are only kept around until we watch them, @@ -64,7 +61,7 @@ echo "xterm -T \"Ripping->$dvdname\" -geometry 72x15+20+10 -bg black -fg white - xterm -T "Ripping->$dvdname" -geometry 72x15+20+10 -bg black -fg white -e "/bin/bash" -c "$ripcmd -d $dest $rip_opts" & ############################################## -# OR run the script directly without displaying a progress window +# OR display the script output directly in the terminal it's called from #$ripcmd -d $dest $rip_opts ##############################################