# HG changeset patch # User attila # Date 1074949418 0 # Node ID cbde5342c574e53bb94e5762899910ee5bb5754a # Parent b4f1df0c1e3a3188a4b3dc65227b577440a01f2a add divx2svcd script. uses mencoder instead of mpegtools by VMiklos diff -r b4f1df0c1e3a -r cbde5342c574 TOOLS/divx2svcd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TOOLS/divx2svcd Sat Jan 24 13:03:38 2004 +0000 @@ -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 <