[Mplayer-felhasznalok] avi-bol svcd
VMiklos
mamajom at axelero.hu
Sun Dec 28 13:54:52 CET 2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sun, 28 Dec 2003, The NeverGone wrote:
> Egy tomoritett avi-bol lehet mencoder -rel svcd-kompatibilis mpeg2
> allomanyt kesziteni? Es ha igen, akkor hogyan? Jo lenne, ha at tudnek
> adni az mpeg2 -nek egy aspect-ratio -t, hogy tudja, milyen meretben kell
> megjelenitenie. Es ha meg lehetne oldani, a filmbol 2 db 80 perces svcd -t
> szeretnek kesziteni. :)
nemtom hagyadszor kuldom ki a listara, de mind1
itt van mellekelve egy divx2svcd szkript, ez mindent +csinal
mi kell neki?
kell: transcode (ha nincs meg, es mar ugyis letoltesz, akkor a
'tcmplex-panteltje' nevu progi keresd, ez csak par kb), meg
mplayer+mencoder :-), 1.0pre3, egy patch (azt is kuldom), meg vcdimager
plz irj, hogy m1-e vagy sem, mert nincs nagyon lehetosegem mas
kornyezetben tesztelni (nekem persze muxik)
udv
- ---
__________ VMiklos / FapadOS & EL Team
____/__/___|___\__. E-mail: mainroot at freemail dot hu
O__O _ | | _ | Homepage: http://www.vmiklos.tk
'--`-(_)'---'--(_)-' gpg --keyserver hkp://pgp.mit.edu --recv-keys 03915096
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/7tKee81tAgORUJYRArrpAJ9fegwfgJSbD6B7S1ibNrqokkXCZQCfV+Qs
W1gUQol8jyg9fblMzEsD5dk=
=1S0P
-----END PGP SIGNATURE-----
-------------- next part --------------
diff -Naur MPlayer-1.0pre3.orig/mplayer.c MPlayer-1.0pre3/mplayer.c
--- MPlayer-1.0pre3.orig/mplayer.c 2003-12-08 22:33:31.000000000 +0100
+++ MPlayer-1.0pre3/mplayer.c 2003-12-18 18:43:51.000000000 +0100
@@ -1494,8 +1494,8 @@
while(!ds->eof){
unsigned char* start;
int in_size=ds_get_packet(ds,&start);
- if( (demuxer->file_format==DEMUXER_TYPE_AVI || demuxer->file_format==DEMUXER_TYPE_ASF || demuxer->file_format==DEMUXER_TYPE_MOV)
- && stream_dump_type==2) fwrite(&in_size,1,4,f);
+/* if( (demuxer->file_format==DEMUXER_TYPE_AVI || demuxer->file_format==DEMUXER_TYPE_ASF || demuxer->file_format==DEMUXER_TYPE_MOV)
+ && stream_dump_type==2) fwrite(&in_size,1,4,f);*/
if(in_size>0) fwrite(start,in_size,1,f);
}
fclose(f);
-------------- next part --------------
#!/bin/bash
# (c) 2003 Vajna Miklos <mainroot at freemail.hu>
# divx2svcd for mencoder
# distributed under GPL License
# version 0.4.2
###preparing###
#help
function usage()
{
echo "
Usage: divx2svcd input_avi [options]
Options:
-b|--bitrate bitrate of mp2 video stream [1600]
-s|--cdsize size of the cd we split the video to [795]
-h|--help this help screen
"
}
#initializating constants
bitrate=1600
cdmeret=795
#checking which mplex utility we have to use
which tcmplex-panteltje >/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
fi
#pharsing parameters
if [ $# -le 0 ]; then
echo "Missing parameter!"
usage
exit 1
fi
case $1 in
-*)
echo "Unknown parameter!"
usage
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)
usage
exit 0
;;
esac
shift 1
done
#checking for sub avariable
if [ -f $nev.sub ]; then
subopts="-sub $nev.sub"
else
subopts=''
fi
#checking for what height needed
aspect=`mplayer -vo null $input -frames 1 |grep aspect |cut -d ' ' -f 5|cut -d : -f 1|tr -s ',' '.'`
svcdaspect=`echo -e "scale=10\n1.596/$aspect"|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
###start working###
#encoding
mencoder -ofps 25 -oac lavc $input -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=$bitrate:acodec=mp2:abitrate=128:keyint=25:aspect=4/3 -o ${nev}2.avi $subopts -srate 44100 -channels 2 $vfopts
#splitting
mplayer -dumpvideo -dumpfile $nev.m2v ${nev}2.avi
mplayer -dumpaudio -dumpfile $nev.mp2 ${nev}2.avi
rm ${nev}2.avi
echo "maxFileSize = $cdmeret" > template
$tcbin -i $nev.m2v $tcopt $nev.mp2 -o $nev.mpg -m s -F template
rm template
rm $nev.m2v $nev.mp2
#creating images
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-felhasznalok
mailing list