while [ $# -gt 0 ]
do
	eval `splitext -e "$1"`
	OFILE="${NAME}".mp4
	if [ "${OFILE}" = "$1" ]
	then
		if ! ffmpeg -i "$1" \
			-s 720x576 -aspect 16:9 \
			-acodec mp3 -ar 44100 -ab 192k \
			-preset ultrafast \
			-r 24000/1001 \
			-y "$$.mp4"
		then
			echo CONVERT ERROR
			rm -f $$.mp4
			exit 1
		fi
		mv $$.mp4 "${OFILE}"
		shift
		continue
	fi
	ffmpeg -i "$1" \
		-s 720x576 -aspect 16:9 -r 24000/1001 \
		-acodec mp3 -ar 44100 -ab 192k \
		-preset ultrafast \
		-y "${OFILE}"
	shift
done
