[MPlayer-dev-eng] divx2svcd-0.5.1

VMiklos mamajom at axelero.hu
Sun Apr 18 14:22:42 CEST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi

here comes the updated version of divx2svcd

the only changed thing is that if the video is smaller than one cd,
vcdimager gets directly the mpg that mencoder created.

the old version dumped the audio and video, and mplexed them using tcmplex

so the conversion process with this new version is faster

greetings

- ---
       __________     VMiklos / FrugalWare & EL Team
  ____/__/___|___\__. E-mail: mamajom at axelero dot hu
O__O  _ |   |   _  |  Homepage: http://www.vmiklos.tk
'--`-(_)'---'--(_)-'  gpg --keyserver pgp.mit.edu --recv-keys 03915096
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAgnMTe81tAgORUJYRAjalAJ0c6JA2P2eK7YRH6eZE7LochIQxkACdHHkW
RF/LkKERMacneM4Eu6xpvCw=
=ag+i
-----END PGP SIGNATURE-----
-------------- next part --------------
diff -Naur main.orig/TOOLS/divx2svcd main/TOOLS/divx2svcd
--- main.orig/TOOLS/divx2svcd	2004-03-05 05:46:30.000000000 +0100
+++ main/TOOLS/divx2svcd	2004-04-18 00:41:02.000000000 +0200
@@ -9,11 +9,14 @@
 # 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
+# http://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0pre3try2.tar.bz2
 
 ###changelog###
 #nobody cares about it :-)
 cat >/dev/null <<EOF
+0.5.1
+- faster code by not re-mplexing one-cd-size or smaller videos
+
 0.5.0
 - needless for dumpvideo patch ;-)
 
@@ -82,7 +85,7 @@
 Usage: `basename $0` input_avi [options]
 
 Options:
--b|--bitrate xx	bitrate of mp2 video stream [1600]
+-b|--bitrate xx	bitrate of mp2 video stream [1375]
 -s|--cdsize xx	size of the cd we split the video to [795]
 -w|--writecd	enables burning [disable]
 -d|--device xx	scsi cd-recording device if you are using linux 2.4.x [0,0,0]
@@ -93,7 +96,7 @@
 }
 
 #initializating constants
-version='0.5.0'
+version='0.5.1'
 bitrate=1375
 cdsize=795
 burning=0
@@ -108,6 +111,9 @@
 echo "DivX2SvcD $version (C) 2003-2004 Vajna Miklos"
 echo
 
+#checking for ls
+ls=`which ls`
+
 #checking for bc
 which bc >/dev/null 2>&1
 bcbin=`which bc 2>/dev/null`
@@ -321,14 +327,20 @@
 #encoding
 mencoder -ofps 25 -oac lavc "$input" -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=$bitrate:acodec=mp2:abitrate=128:keyint=25:aspect=4/3:$paraopts -o "${nev}2.avi" -srate 44100 -of mpeg -channels 2 $vfopts $subs "$subopts"
 
-#splitting
-mplayer -dumpvideo -dumpfile "$nev.m2v" "${nev}2.avi"
-mplayer -dumpaudio -dumpfile "$nev.mp2" "${nev}2.avi"
-rm "${nev}2.avi"
-echo "maxFileSize = $cdsize" > template
-$tcbin -i "$nev.m2v" $tcopt "$nev.mp2" -o "$nev.mpg" -m s -F template
-rm template
-rm "$nev.m2v" "$nev.mp2"
+videosize=`$ls -l "${nev}2.avi"|tr -s ' '|cut -d ' ' -f5`
+if ! [ `echo $(( $cdsize*1048576 < $videosize ))` == "1" ]; then
+	#video is smaller, than $cdsize
+	mv ${nev}2.avi ${nev}00.mpg
+else
+	#splitting
+	mplayer -dumpvideo -dumpfile "$nev.m2v" "${nev}2.avi"
+	mplayer -dumpaudio -dumpfile "$nev.mp2" "${nev}2.avi"
+	rm "${nev}2.avi"
+	echo "maxFileSize = $cdsize" > template
+	$tcbin -i "$nev.m2v" $tcopt "$nev.mp2" -o "$nev.mpg" -m s -F template
+	rm template
+	rm "$nev.m2v" "$nev.mp2"
+fi
 
 for i in *mpg
 do


More information about the MPlayer-dev-eng mailing list