echo >&2 " 5) If dvdname is a full path to a VOB file, it will be ripped as a DVD instead of $dev"
echo >&2 " -p <profile> Specify which encoding profile to use in -x mode as shown below:"
echo >&2 " Mencoder and Handbrake Encoder Profiles:"
echo >&2 " 5) If dvdname is a full path to a VOB file, it will be ripped as a DVD instead of $dev"
echo >&2 " -p <profile> Specify which encoding profile to use in -x mode as shown below:"
echo >&2 " Mencoder and Handbrake Encoder Profiles:"
- echo >&2 " - xvidvhq = AVI, very high quality encoding, Xvid codec, 2 pass encoding (default)"
- echo >&2 " - xvidhq = AVI, high quality encoding, Xvid codec, 2 pass encoding"
+ echo >&2 " - xvidvhq = AVI, very high quality encoding, Xvid codec, 2 pass encoding"
+ echo >&2 " - xvidhq = AVI, high quality encoding, Xvid codec, 2 pass encoding (default)"
echo >&2 " - xvid = AVI, fast encoding, Xvid codec, 2 pass encoding"
echo >&2 " - iphone = MP4, x264 codec, 2 pass encoding, forced 480:320 scaling"
echo >&2 " - ipod = MP4, x264 codec, 2 pass encoding, forced 320:240 scaling"
echo >&2 " - xvid = AVI, fast encoding, Xvid codec, 2 pass encoding"
echo >&2 " - iphone = MP4, x264 codec, 2 pass encoding, forced 480:320 scaling"
echo >&2 " - ipod = MP4, x264 codec, 2 pass encoding, forced 320:240 scaling"
echo >&2 " -f Make the final image a DVD folder"
echo >&2 " -z Make the final image a compressed file based on your profile selection and encoder"
echo >&2 " -e <encoder> Specify the encoder to use to make the compressed file (valid encoders=mencoder|handbrake) (default=handbrake if found)"
echo >&2 " -f Make the final image a DVD folder"
echo >&2 " -z Make the final image a compressed file based on your profile selection and encoder"
echo >&2 " -e <encoder> Specify the encoder to use to make the compressed file (valid encoders=mencoder|handbrake) (default=handbrake if found)"
echo >&2 " -s <size> Set the target size of the compressed file in MB (ex: 700, 1000, etc)"
echo >&2 " -b <bitrate> Set the bitrate desired in the compressed file in kbits/sec (ex: 1500, 2000 (default), etc)"
echo >&2 " -a <W:H> Specify the width x height aspect ratio to scale the DVD to (only used in -x mode)"
echo >&2 " -s <size> Set the target size of the compressed file in MB (ex: 700, 1000, etc)"
echo >&2 " -b <bitrate> Set the bitrate desired in the compressed file in kbits/sec (ex: 1500, 2000 (default), etc)"
echo >&2 " -a <W:H> Specify the width x height aspect ratio to scale the DVD to (only used in -x mode)"
encoder="mencoder"; # If we can't find handbrake, set mencoder as the default
[[ -x `which $handbrake_xvid` ]] && [[ "$profile" =~ "xvid" ]] && encoder="handbrake";
[[ -x `which $handbrake_mp4` ]] && [[ "$profile" =~ "mp4" ]] && encoder="handbrake";
encoder="mencoder"; # If we can't find handbrake, set mencoder as the default
[[ -x `which $handbrake_xvid` ]] && [[ "$profile" =~ "xvid" ]] && encoder="handbrake";
[[ -x `which $handbrake_mp4` ]] && [[ "$profile" =~ "mp4" ]] && encoder="handbrake";
[[ ! -x `which mkisofs` ]] && echo "-E- missing dependency: mkisofs" && 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
[[ ! -x `which mkisofs` ]] && echo "-E- missing dependency: mkisofs" && 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" =~ "hb" ]] && [[ ! -x `which $handbrake_mp4` ]] && echo "-E- missing encoder: $handbrake_mp4" && exit
[[ "$encoder" == "handbrake" ]] && [[ ! -x `which ffmpeg` ]] && echo "-E- missing dependency: ffmpeg" && exit
[[ "$encoder" == "handbrake" ]] && [[ "$profile" =~ "hb" ]] && [[ ! -x `which $handbrake_mp4` ]] && echo "-E- missing encoder: $handbrake_mp4" && exit
[[ "$encoder" == "handbrake" ]] && [[ ! -x `which ffmpeg` ]] && echo "-E- missing dependency: ffmpeg" && exit
- # get our audio track from the VOB file
- get_audio_track_from_vob "$vobfile"
+ # get our audio track from the VOB file (requires mp4 version of handbrake to extract)
+ get_audio_track_from_vob "$vobfile" "$handbrake_mp4"
if [ "$profile" == "xvidvhq" ]; then
handbrake_opts[0]="-f avi"
handbrake_opts[1]="-b $target_bitrate"
if [ "$profile" == "xvidvhq" ]; then
handbrake_opts[0]="-f avi"
handbrake_opts[1]="-b $target_bitrate"
cat $encodelog | grep "Encoding:" | sed 's/\r/\n/g' | grep "Encoding:" | grep "ETA" | head -1 >> "$logfile"
cat $encodelog | grep "Encoding:" | sed 's/\r/\n/g' | grep "Encoding:" | grep "ETA" | tail -1 >> "$logfile"
}
cat $encodelog | grep "Encoding:" | sed 's/\r/\n/g' | grep "Encoding:" | grep "ETA" | head -1 >> "$logfile"
cat $encodelog | grep "Encoding:" | sed 's/\r/\n/g' | grep "Encoding:" | grep "ETA" | tail -1 >> "$logfile"
}
# Adjust our audio ID to find the english audio stream
# This should be 128. However, if 128 is not there, pick the next one that incrementally is.
vob="$1"
# Adjust our audio ID to find the english audio stream
# This should be 128. However, if 128 is not there, pick the next one that incrementally is.
vob="$1"