Add a note about Ubuntu and libdvdcss2
[rip_dvd/.git] / rip_dvd
diff --git a/rip_dvd b/rip_dvd
index f58a00b0a6df9b4cef9a209ba79d5ad52eba3fe0..ecf2f6705d65055e77e77c84294630a9dfa0d5ed 100755 (executable)
--- a/rip_dvd
+++ b/rip_dvd
@@ -3,7 +3,7 @@
 # Author: Alan J. Pippin (apippin@pippins.net)
 # Date: 05/17/2009
 #
-  REV=2.0
+  REV=2.2
 #
 # Description: This script wraps a number of linux utilities to
 # create a recipe for ripping protected DVDs, circumventing 
@@ -475,6 +475,7 @@ function encode_vob_file_handbrake {
   typeset filetype=""
   typeset handbrake_audio_opts=""
   typeset hb_profile=""
+  typeset SIZE=""
 
   # Set a variable that we will use later to determine if we found a handler for $profile or not
   typeset -i found_profile=0    
@@ -487,6 +488,10 @@ function encode_vob_file_handbrake {
   # Set our DRC option
   DRC="-D $drc"
 
+  if [ $target_size -ne 0 ]; then
+    SIZE="-S $target_size"
+  fi 
+
   # Check the global force_onepass_mode. If it is set, change our variables appropriately
   # to force 1-pass encoding across all profiles.
   if [ $force_onepass_mode -eq 1 ]; then
@@ -647,6 +652,7 @@ function encode_vob_file_handbrake {
   handbrake_cmd_line_opts="$handbrake_cmd_line_opts $PASSES"
   handbrake_cmd_line_opts="$handbrake_cmd_line_opts $DRC"
   handbrake_cmd_line_opts="$handbrake_cmd_line_opts $SCALE"
+  handbrake_cmd_line_opts="$handbrake_cmd_line_opts $SIZE"
 
   # Execute the handbrake command to encode the video
   if [ -n "$hb_profile" ]; then
@@ -1102,7 +1108,7 @@ function get_audio_track_from_vob {
   track=`expr match "$stream" '^\([0-9]*\):'`
 
   if [ -n "$track" ]; then   
-    echo "-> Setting the audio ID to $aid. Setting the audio track to $track." | tee -a "$logfile"
+    echo "   Setting the audio ID to $aid. Setting the audio track to $track." | tee -a "$logfile"
   fi
 }
 
@@ -1239,6 +1245,7 @@ function calculate_bitrate_from_target_size {
   if [ $target_size -ne 0 ]; then
     vob_length=`mplayer -identify -v "$vobfile" -endpos 0 2>&1 | grep ID_LENGTH | awk -F '=' '{ print $2 }' | awk -F '.' '{ print $1 }'`
     ((target_bitrate = (target_size * 1024 * 8) / vob_length ))
+    custom_bitrate=1
     echo "   With a given target size of $target_size MB, the estimated bit rate will need to be $target_bitrate kbits/sec"
   fi
 }