[MPlayer-users] svcd convert

VMiklos mamajom at axelero.hu
Mon Oct 27 20:34:06 CET 2003


hello

on the hungarian list Leva asked me to send him a usable script for
creating svcds.

the attached script is 5 times faster than the mencvcd script placed at
the TOOLS directory of MPlayer source

this or a script like this would have to be at the TOOLS directory in my
opinion, because mencoder is better than mencvcd shows it!

developers, if you would take my script, it would be nice to say me what i
have to modify in my script to be sutable for the developers.

greetings, VMiklos


       __________     Vajna Miklos
  ____/__/___|___\__. E-mail: mainroot at freemail.hu
O__O  _ |   |   _  |  Honlap: http://www.vmiklos.tk
'--`-(_)'---'--(_)-'  ***e'kezet,HTML>OK!***
-------------- next part --------------
#!/bin/bash

# (c) 2003 Vajna Miklos <mainroot at freemail.hu>
# divx2svcd for mencoder
# distributed under GPL License

# version 0.3.2

#initializating constants
bitrate=1600
cdmeret=795
freq=44100

#pharsing parameters

if [ $# -le 0 ]; then
	echo "RTFM!"
	exit 1
fi

case $1 in
	-*)
		echo "RTFM!"
		exit 1
	;;
	*)
		input=$1
		nev=`basename $input .avi`
		shift 1
	;;
esac

while [ "$1"x != "x" ]; do
   case $1 in
      -b|--bitrate)
        bitrate=$2
	shift 1
        ;;
      -s|--cdsize)
      	cdmeret="$2"
	shift 1
	;;
      -h|--help)
      echo "RTFM!"
        exit 0
	;;
      -f|--audiofreq)
      	freq=$2 #40517
	shift 1
	;;
   esac
   shift 1
done

mencoder -ofps 25 -oac copy $input -vop scale=480:576 -ovc lavc -lavcopts vrc_override=1,10,708:vqcomp=0.1:vcodec=mpeg2video:vratetol=10000000:vbitrate=$bitrate:mbd=2:keyint=25:aspect=4/3:dia=1:precmp=0:cmp=0:subcmp=0:scplx_mask=0.08 -o ${nev}2.avi
mplayer -dumpvideo -dumpfile $nev.m2v ${nev}2.avi
mplayer ${nev}2.avi -vc null -vo null -ao pcm -af resample=$freq
mv audiodump.wav $nev.wav
rm ${nev}2.avi
toolame -b 128 $nev.wav $nev.mp2
rm $nev.wav
echo "maxFileSize = $cdmeret" > template
tcmplex -i $nev.m2v -0 $nev.mp2 -o $nev.mpg -m s -F template
rm template
rm $nev.m2v $nev.mp2
for i in $nev*mpg ; do
	nev2=`basename $i .mpg`
	vcdimager -t svcd -c $nev2.cue -b $nev2.bin $i
done
rm $nev*mpg


More information about the MPlayer-users mailing list