X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=rip_dvd;h=4b3223865d79d429311a2ea44a742d4ad94b277a;hb=1b45d633c67e15045b8a6ba6113913af08bc163b;hp=e68012a3f237df2190c5053bbb67477ef8885fd6;hpb=3af52d5a056fe3392d7505dedf7ead0d8bcd9b7c;p=rip_dvd%2F.git diff --git a/rip_dvd b/rip_dvd index e68012a..4b32238 100755 --- 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 @@ -281,6 +281,8 @@ fi [[ ! -x `which makexml` ]] && echo "-E- missing dependency: makexml" && exit [[ ! -x `which dvdauthor` ]] && echo "-E- missing dependency: dvdauthor" && exit [[ ! -x `which mkisofs` ]] && echo "-E- missing dependency: mkisofs" && exit +[[ -n "$handbrake_xvid" ]] && [[ ! -x `which $handbrake_xvid` ]] && echo "-E- missing handbrake xvid encoder, set in rip_dvd.conf to: $handbrake_xvid" && exit +[[ -n "$handbrake_mp4" ]] && [[ ! -x `which $handbrake_mp4` ]] && echo "-E- missing handbrake mp4 encoder, set in rip_dvd.conf to: $handbrake_mp4" && exit [[ "$encoder" == "handbrake" ]] && [[ "$profile" =~ "xvid" ]] && [[ ! -x `which $handbrake_xvid` ]] && echo "-E- missing encoder: $handbrake_xvid" && exit [[ "$encoder" == "handbrake" ]] && [[ "$profile" =~ "mp4" ]] && [[ ! -x `which $handbrake_mp4` ]] && echo "-E- missing encoder: $handbrake_mp4" && exit [[ "$encoder" == "handbrake" ]] && [[ "$profile" =~ "ip" ]] && [[ ! -x `which $handbrake_mp4` ]] && echo "-E- missing encoder: $handbrake_mp4" && exit @@ -475,6 +477,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 +490,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,8 +654,11 @@ 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 + # I have to copy-n-paste the code below to handle the 2 conditions, 1) hb_profile (mp4) 2) no hb_profile (xvid) + # The problem is the -Z "$hb_profile" option. I have to quote the "$hb_profile" due to spaces in it, forcing me to call it out explicity. if [ -n "$hb_profile" ]; then echo -e "\n Encoding: $handbrake_cli -i \"$vobfile\" -o \"$final_output_file\" -Z \"$hb_profile\" $handbrake_cmd_line_opts $handbrake_audio_opts $handbrake_video_encoder_opts >> $encodelog 2>&1" >> "$logfile" $handbrake_cli -i "$vobfile" -o "$final_output_file" -Z "$hb_profile" $handbrake_cmd_line_opts $handbrake_audio_opts $handbrake_video_encoder_opts >> $encodelog 2>&1