#!/bin/bash
#########################################################
# 							#
# This is BashStyle-NG  				#
#							#
# Licensed under GNU GENERAL PUBLIC LICENSE v3    	#
#							#
# Copyright 2007 - 2010 Christopher Bratusek		#
#							#
#########################################################

youtube2ogg () {

	ffmpeg -i "$1" -vn "$1".ogg

}

conv2avi () {

	if [[ $(which mencoder-mt) != "" ]]; then

	mencoder-mt "$1" -lavdopts threads=8 \
	  -ovc xvid -xvidencopts fixed_quant=4 -of avi \
	  -oac mp3lame -lameopts vbr=3 \
	  -o "$1".avi

	else

	mencoder "$1" -lavdopts \
	  -ovc xvid -xvidencopts fixed_quant=4 -of avi \
	  -oac mp3lame -lameopts vbr=3 \
	  -o "$1".avi

	fi

}

geniso () {

	if [[ $CD_WRITER ]]; then
		dd $DD_OPTS if=$CD_WRITER of="$1"
	else	dd $DD_OPTS if=/dev/dvdrw of="$1"
	fi

}

writeiso () {

	if [[ $CD_WRITER ]]; then
		cdrecord dev=$CD_WRITER "$1"
	else	cdrecord deV=/dev/dvdrw "$1"
	fi

}
