From 774cd5372cab8e9265d62cc5e07ce707578cfa89 Mon Sep 17 00:00:00 2001 From: "Alan J. Pippin" Date: Sun, 14 Feb 2010 07:17:11 -0700 Subject: [PATCH] Added code to allow a video bitrate and target size to be given on the command line. This allows the code that tries to auto calculate the bitrate from target_size to be overridden. --- rip_dvd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rip_dvd b/rip_dvd index e025e57..879920b 100755 --- a/rip_dvd +++ b/rip_dvd @@ -1101,7 +1101,7 @@ function get_audio_track_from_vob { # extract the audio streams in the vob #ffmpeg -i "$vob" > $aidcheck 2>&1 - $handbrake_cli --stop-at 0 -i "$vob" -o /dev/null -v 100 > $aidcheck 2>&1 + $handbrake_cli --stop-at duration:1 -i "$vob" -o /dev/null -v 100 > $aidcheck 2>&1 # find the stream that matches our aid #stream=`grep "Stream.*\[0x$aid_hex\]" $aidcheck` @@ -1247,11 +1247,11 @@ function check_vob_for_a52_crc_errors { function calculate_bitrate_from_target_size { # determine what our bitrate needs to be if a target size was specified instead - if [ $target_size -ne 0 ]; then + if [ $target_size -ne 0 ] && [ $custom_video_bitrate -eq 0 ]; then vob_length=`mplayer -identify -v "$vobfile" -endpos 0 2>&1 | grep ID_LENGTH | awk -F '=' '{ print $2 }' | awk -F '.' '{ print $1 }'` ((target_video_bitrate = (target_size * 1024 * 8) / vob_length )) custom_video_bitrate=1 - echo " With a given target size of $target_size MB, the estimated bit rate will need to be $target_video_bitrate kbits/sec" + echo " With a given target size of $target_size MB, the estimated bit rate will need to be $target_video_bitrate kbits/sec" | tee -a "$logfile" fi } -- 2.34.1