X-Git-Url: http://git.pippins.net/embedvideo/.git/.%24link.?a=blobdiff_plain;f=rip_dvd;h=f58a00b0a6df9b4cef9a209ba79d5ad52eba3fe0;hb=fce9af63c8b25a5b770721f2e2362a4b1cafe6b8;hp=18a1830b27bf1f53a78b49ffb2b227b4baf53d85;hpb=8489a9163544ea5db0448d031ef521bc3ea3c452;p=rip_dvd%2F.git diff --git a/rip_dvd b/rip_dvd index 18a1830..f58a00b 100755 --- a/rip_dvd +++ b/rip_dvd @@ -67,6 +67,9 @@ typeset -i audio_6ch=1 typeset -i invalid_feature_title=0 typeset -i feature_title_override=0 typeset -i mplayer_dumpstream_incompatibility=0 +typeset -i custom_bitrate=0 +typeset -i custom_audio_2ch=0 +typeset -i custom_audio_6ch=0 ############################################################################## # Local Machine Settings: @@ -107,10 +110,10 @@ do case $opt in (n) dvdname=$OPTARG;; (d) dest=$OPTARG;; - (b) target_bitrate=$OPTARG;; + (b) target_bitrate=$OPTARG; custom_bitrate=1;; (s) target_size=$OPTARG;; - (2) audio_2ch=1;; - (6) audio_6ch=1;; + (2) audio_2ch=1; custom_audio_2ch=1;; + (6) audio_6ch=1; custom_audio_6ch=1;; (1) force_onepass_mode=1;; (v) make_final_dest_vob=1;; (i) make_final_dest_iso=1;; @@ -533,6 +536,17 @@ function encode_vob_file_handbrake { final_output_file="$dest/$dvdname.mp4" PASSES="" + # Handle custom parameter overrides + if [ $custom_bitrate == 1 ]; then + handbrake_opts[0]="-b $target_bitrate" + fi + if [ $custom_audio_2ch == 0 ]; then + audio_2ch=0 + fi + if [ $custom_audio_6ch == 0 ]; then + audio_6ch=0 + fi + # Very High Quality if [ "$profile" == "mp4vhq" ]; then profile="hb_High_Profile" @@ -553,17 +567,27 @@ function encode_vob_file_handbrake { handbrake_cli="$handbrake_mp4" final_output_file="$dest/$dvdname.mp4" PASSES="" - audio_2ch=1 - audio_6ch=0 + + # Handle custom parameter overrides + if [ $custom_bitrate == 1 ]; then + handbrake_opts[0]="-b $target_bitrate" + fi + if [ $custom_audio_2ch == 0 ]; then + audio_2ch=0 + fi + if [ $custom_audio_6ch == 0 ]; then + audio_6ch=0 + fi # iphone if [ "$profile" == "iphone" ]; then - profile="hb_iPhone" + profile="hb_iPhone_&_iPod_Touch" fi # ipod if [ "$profile" == "ipod" ]; then profile="hb_iPod" fi + fi # Predefined Handbrake Profile Handling @@ -572,6 +596,17 @@ function encode_vob_file_handbrake { handbrake_cli="$handbrake_mp4" final_output_file="$dest/$dvdname.mp4" PASSES="" + + # Handle custom parameter overrides + if [ $custom_bitrate == 1 ]; then + handbrake_opts[0]="-b $target_bitrate" + fi + if [ $custom_audio_2ch == 0 ]; then + audio_2ch=0 + fi + if [ $custom_audio_6ch == 0 ]; then + audio_6ch=0 + fi # extract the HandBrake Profile name from $profile hb_profile=`echo "$profile" | sed 's/hb_//g' | sed 's/_/ /g'` @@ -1059,7 +1094,8 @@ function get_audio_track_from_vob { # find the stream that matches our aid #stream=`grep "Stream.*\[0x$aid_hex\]" $aidcheck` - stream=`grep "scan: audio" $aidcheck | grep -n "" | grep "scan: audio 0x$aid_hex"` + #stream=`grep "scan: audio" $aidcheck | grep -n "" | grep "scan: audio 0x$aid_hex"` + stream=`grep "add_audio_to_title:" $aidcheck | grep -n "" | grep "add_audio_to_title:.* stream 0x$aid_hex"` # extract the track number that handbrake uses #track=`expr match "$stream" '.*#[0-9]\.\([0-9]*\)'`