[Mplayer-cvslog] CVS: main/TOOLS divx2svcd,1.3,1.4

Diego Biurrun CVS syncmail at mplayerhq.hu
Fri Apr 23 17:52:47 CEST 2004


CVS change done by Diego Biurrun CVS

Update of /cvsroot/mplayer/main/TOOLS
In directory mail:/var2/tmp/cvs-serv31344/TOOLS

Modified Files:
	divx2svcd 
Log Message:
update to version 0.5.1 by the author VMiklos <mamajom at axelero.hu>


Index: divx2svcd
===================================================================
RCS file: /cvsroot/mplayer/main/TOOLS/divx2svcd,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- divx2svcd	5 Mar 2004 04:46:30 -0000	1.3
+++ divx2svcd	23 Apr 2004 15:52:44 -0000	1.4
@@ -4,16 +4,19 @@
 # divx2svcd for MPlayer
 # distributed under GPL License
 
-# A simple utility that creates SvcD from a video which uses avi container
+# simple utility that creates a SVCD from a video in an 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
+# MPlayer available at
+# http://www.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-cvslog mailing list