From 23f7e1c60414661c3558789486acab71549773d9 Mon Sep 17 00:00:00 2001 From: attila Date: Sat, 24 Jan 2004 13:03:38 +0000 Subject: add divx2svcd script. uses mencoder instead of mpegtools by VMiklos git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11840 b3059339-0415-0410-9bf9-f77b7e298cf2 --- TOOLS/divx2svcd | 350 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 350 insertions(+) create mode 100755 TOOLS/divx2svcd (limited to 'TOOLS') diff --git a/TOOLS/divx2svcd b/TOOLS/divx2svcd new file mode 100755 index 0000000000..e013fc6da9 --- /dev/null +++ b/TOOLS/divx2svcd @@ -0,0 +1,350 @@ +#!/bin/bash + +# (c) 2003 Vajna Miklos +# divx2svcd for MPlayer 1.0pre3+dumpvideo patch +# distributed under GPL License + +# A simple utility that creates SvcD from a video which uses avi container + +# The newest version of this utility can be found at +# http://vmiklos.uw.hu/divx2svcd/divx2svcd + +# MPlayer avariable at +# http://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0pre3.tar.bz2 +# dumpvideo patch at +# http://vmiklos.uw.hu/divx2svcd/mplayer-1.0pre3-dumpvideo.diff + +###changelog### +#nobody cares about it :-) +cat >/dev/null < +- support for toolame instead of mp2enc +- suppert for libavcodec mpeg2video codec instead of mpeg2enc + +0.2 +- support for tcmplex instead of mplex + +0.1rc2-rc4 +- small bugfixes + +0.1rc1 +- initial release + +EOF + + +###preparing### +#help + +function usage() +{ + cat </dev/null 2>&1 +bcbin=`which bc 2>/dev/null` +if [ $? != 0 ]; then + cat </dev/null 2>&1 +bcbin=`which vcdimager 2>/dev/null` +if [ $? != 0 ]; then + cat </dev/null 2>&1 +if [ $? = 0 ]; then + tcp_path=`which tcmplex-panteltje 2>&1` +else + tcp_path="x" +fi +which tcmplex >/dev/null 2>&1 +if [ $? = 0 ]; then + tc_path=`which tcmplex 2>&1` +else + tc_path="x" +fi + +if [ -x $tcp_path ]; then + tcbin=tcmplex-panteltje + tcopt=-0 +elif [ -x $tc_path ]; then + tcbin=tcmplex + tcopt=-p +else + cat </dev/null 2>&1 +cdrbin=`which cdrecord 2>/dev/null` +if [ $? != 0 ]; then + cat <= 2.01a14 + echo -n "Checking for cdrecord version >= 2.01a14... " + $cdrbin cuefile=a 2>&1 |grep 'Bad Option' >/dev/null 2>&1 + if [ "$?" == 0 ]; then + cat <= 2.01a14. You can download it at +ftp://ftp.berlios.de/pub/cdrecord/alpha/cdrtools-2.01a20.tar.gz +EOF + else + echo "`$cdrbin -version |cut -d ' ' -f 2`" + fi +fi +fi + +#checking for sub avariable + +if [ -f "$nev.sub" ]; then + subopts=$nev.sub +else + subopts='' +fi + +if [ "x$subopts" == "x" ]; then + subs='' +else + subs='-sub ' +fi + +#checking for what height needed +inputwidth=`mplayer -vo null -ao null "$input" -frames 1 2>/dev/null |grep '=>'|cut -d ' ' -f 5|cut -d x -f 1` +inputheight=`mplayer -vo null -ao null "$input" -frames 1 2>/dev/null |grep '=>'|cut -d ' ' -f 5|cut -d x -f 2` +svcdaspect=`echo -e "scale=10\n1.596/($inputwidth/$inputheight)"|bc /dev/stdin` +height=`echo -e "scale=10\n$svcdaspect*480"|bc /dev/stdin|cut -d . -f 1` + +#checking for ratios less than 1.33 +istoohigh=`expr $height \> 577` +if [ "$istoohigh" = 1 ]; then + height=576 +fi + +#find out the vf options +if [ "$height" = 576 ]; then + vfopts='-vf scale=480:576' +else + #-vf processes filters in reverse order + exy=`echo -e "scale=10\n(576-$height)/2"|bc /dev/stdin|cut -d . -f 1` + vfopts="-vf scale=480:$height,expand=480:576:0:$exy:1" + echo "Using filter options: '$vfopts'" +fi + +#finish displaying informations +if [ "$burning" == 1 ]; then +#asking for cd +cat < template +$tcbin -i "$nev.m2v" $tcopt "$nev.mp2" -o "$nev.mpg" -m s -F template +rm template +rm "$nev.m2v" "$nev.mp2" + +`which ls` -N "$nev"*mpg | while read i +do + nev2=`basename "$i" .mpg` + #creating images + vcdimager -t svcd -c "$nev2.cue" -b "$nev2.bin" "$i" + #burning if needs + if [ "$burning" == 1 ]; then + if ["$firstcd" != 1 ]; then + cat <