- ((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" | tee -a "$logfile"
+ ((min_length = minimum_feature_title_length * 60))
+ if [[ $vob_length -gt $min_length ]]; then
+ ((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" | tee -a "$logfile"
+ else
+ echo "-W- Unable to determine the real length of this DVD feature title." | tee -a "$logfile"
+ echo " A target bitrate from the target_size requested will not be set." | tee -a "$logfile"
+ echo " If using handbrake, only the target_size will be passed to the encoder." | tee -a "$logfile"
+ echo " If using mencoder, the target_size will be entirely disregarded." | tee -a "$logfile"
+ echo " You may need to rerun with the -b option with a target bitrate to get the desired size." | tee -a "$logfile"
+ if [[ $encoder -ne "handbrake" ]] || [[ "$profile" =~ "xvid" ]]; then
+ fatal_and_exit "-E- You'll need rip this DVD with the handbrake encoder and an MP4 type profile to get a good rip."
+ fi
+ fi