mirror of
https://github.com/mpv-player/mpv
synced 2024-12-25 00:02:13 +00:00
update by the author (v0.2.2)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10210 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
6655e69f0d
commit
9d5de25fb2
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Version: 0.2
|
# Version: 0.2.2
|
||||||
#
|
#
|
||||||
# Licence: GPL
|
# Licence: GPL
|
||||||
#
|
#
|
||||||
@ -22,7 +22,7 @@ for exe in mplayer mpeg2enc mp2enc mplex yuvscaler ; do
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
for exe in vcdimager lame cdrdao yuvdenoise sox toolame ; do
|
for exe in vcdimager lame cdrdao yuvdenoise sox toolame normalize; do
|
||||||
if [ -z "`which $exe`" ]; then
|
if [ -z "`which $exe`" ]; then
|
||||||
echo "WARNING: $exe is not found in your path $PATH!"
|
echo "WARNING: $exe is not found in your path $PATH!"
|
||||||
fi
|
fi
|
||||||
@ -68,6 +68,11 @@ done
|
|||||||
# - new options: "-sox", "-volume", "-toolame"
|
# - new options: "-sox", "-volume", "-toolame"
|
||||||
# - renamed "-mpg" to "-mpegsrc"
|
# - renamed "-mpg" to "-mpegsrc"
|
||||||
# - default cd size changed to 800mb
|
# - default cd size changed to 800mb
|
||||||
|
# 2002/11/18 v0.2.1
|
||||||
|
# - aspect ratio for vcd's, too
|
||||||
|
# - pulldown mode...
|
||||||
|
# 2002/12/01 v0.2.2
|
||||||
|
# - -normalize
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
@ -88,7 +93,9 @@ SVCDMODE=5
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
function usage() {
|
function usage() {
|
||||||
echo "Usage: $HOWCALLED <name> [$HOWCALLED options] [mplayer options]"
|
echo "Usage: $HOWCALLED <basename> [$HOWCALLED options] [mplayer options]"
|
||||||
|
echo
|
||||||
|
echo " <basename> is used as basename of the resulting mpg/bin files."
|
||||||
echo
|
echo
|
||||||
echo "For mplayer options see mplayer help and manual."
|
echo "For mplayer options see mplayer help and manual."
|
||||||
echo
|
echo
|
||||||
@ -111,6 +118,9 @@ function usage() {
|
|||||||
echo " encoded mpg stream."
|
echo " encoded mpg stream."
|
||||||
echo "-mpgonly do only encoding to mpeg 1/2 format."
|
echo "-mpgonly do only encoding to mpeg 1/2 format."
|
||||||
echo "-noburn disables burning."
|
echo "-noburn disables burning."
|
||||||
|
echo "-normalize use 'normalize'."
|
||||||
|
echo "-overburn enables overburning a cd."
|
||||||
|
echo "-pulldown enable pulldown mode in output."
|
||||||
echo "-ratio <s> output ratio size of frames, see yuvscaler (1)."
|
echo "-ratio <s> output ratio size of frames, see yuvscaler (1)."
|
||||||
echo "-size <X>x<Y> sets output size of frames."
|
echo "-size <X>x<Y> sets output size of frames."
|
||||||
echo "-sox use sox for audio resampling."
|
echo "-sox use sox for audio resampling."
|
||||||
@ -151,15 +161,28 @@ function usage() {
|
|||||||
echo "this encodes 1500 frames of dvd title 1 with subtitle 0 and audio stream"
|
echo "this encodes 1500 frames of dvd title 1 with subtitle 0 and audio stream"
|
||||||
echo "128 starting from 3:00 with frame rate 29.97 fps and input video norm NTSC"
|
echo "128 starting from 3:00 with frame rate 29.97 fps and input video norm NTSC"
|
||||||
echo "and output frame rate 23.98 fps because of the 3:2 pulldown method in NTSC."
|
echo "and output frame rate 23.98 fps because of the 3:2 pulldown method in NTSC."
|
||||||
|
echo
|
||||||
|
echo "'$HOWCALLED bj -size 640x272 -vop expand=640:480:0:104:0 \\"
|
||||||
|
echo " -cdsize 645 -noburn bj.avi'"
|
||||||
|
echo "this example above shows you, how to deal with movies which are not"
|
||||||
|
echo "created with aspect ratios of 4:3 or 16:9."
|
||||||
}
|
}
|
||||||
|
|
||||||
HOWCALLED=`basename $0`
|
HOWCALLED=`basename $0`
|
||||||
NAME=$1
|
|
||||||
if [ $# -le 1 ]; then
|
if [ $# -le 1 ]; then
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
shift 1
|
case $1 in
|
||||||
|
-*)
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
NAME=$1
|
||||||
|
shift 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
cd $TMPDIR
|
cd $TMPDIR
|
||||||
rm -f $VIDEO
|
rm -f $VIDEO
|
||||||
@ -195,6 +218,9 @@ sync=""
|
|||||||
sox=0
|
sox=0
|
||||||
toolame=0
|
toolame=0
|
||||||
volume="1.0"
|
volume="1.0"
|
||||||
|
overburn=""
|
||||||
|
pd=""
|
||||||
|
norm=0
|
||||||
|
|
||||||
while [ "$1"x != "x" ]; do
|
while [ "$1"x != "x" ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
@ -232,6 +258,12 @@ while [ "$1"x != "x" ]; do
|
|||||||
burnonly=1
|
burnonly=1
|
||||||
burn=1
|
burn=1
|
||||||
;;
|
;;
|
||||||
|
-overburn)
|
||||||
|
overburn="--overburn"
|
||||||
|
;;
|
||||||
|
-pulldown)
|
||||||
|
pd="-p"
|
||||||
|
;;
|
||||||
-vfr)
|
-vfr)
|
||||||
framerate="-F $2"
|
framerate="-F $2"
|
||||||
shift 1
|
shift 1
|
||||||
@ -245,6 +277,9 @@ while [ "$1"x != "x" ]; do
|
|||||||
-mpgonly)
|
-mpgonly)
|
||||||
mpgonly=1
|
mpgonly=1
|
||||||
;;
|
;;
|
||||||
|
-normalize)
|
||||||
|
norm=1
|
||||||
|
;;
|
||||||
-vnorm)
|
-vnorm)
|
||||||
yuvin="-n $2"
|
yuvin="-n $2"
|
||||||
shift 1
|
shift 1
|
||||||
@ -298,7 +333,7 @@ mpegnorm="-f $VCDMODE -b $vbr -B 260 -V 46"
|
|||||||
if [ "$norm" == "SVCD" ]; then
|
if [ "$norm" == "SVCD" ]; then
|
||||||
[ $vbrset -eq 0 ] && vbr=2500
|
[ $vbrset -eq 0 ] && vbr=2500
|
||||||
mplexnorm="-f $SVCDMODE -m 2 -V -b 230"
|
mplexnorm="-f $SVCDMODE -m 2 -V -b 230"
|
||||||
mpegnorm="-f $SVCDMODE -b $vbr -B 260 -V 230 $aratio"
|
mpegnorm="-f $SVCDMODE -b $vbr -B 260 -V 230"
|
||||||
imaget="-t svcd"
|
imaget="-t svcd"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -328,12 +363,15 @@ if [ $burnonly -eq 0 ]; then
|
|||||||
# mjpegtools
|
# mjpegtools
|
||||||
($denoise < $VIDEO | \
|
($denoise < $VIDEO | \
|
||||||
yuvscaler -v 0 $wide -O $norm $size $yuvin | \
|
yuvscaler -v 0 $wide -O $norm $size $yuvin | \
|
||||||
mpeg2enc -v 0 -s $mpegnorm -S $CDMAXSIZE -g 6 -G 15 -r 16 \
|
mpeg2enc -v 0 -s $mpegnorm $aratio -S $CDMAXSIZE -g 6 -G 15 -r 16 \
|
||||||
$framerate $yuvin -4 2 -2 1 -o $NAME.mpv) &
|
$pd $framerate $yuvin -4 2 -2 1 -o $NAME.mpv) &
|
||||||
|
|
||||||
# wait for finishing the subprocesses
|
# wait for finishing the subprocesses
|
||||||
wait
|
wait
|
||||||
|
|
||||||
|
# normalize sound
|
||||||
|
[ $norm -eq 1 ] && (echo "normalizing sound..."; normalize $AUDIO)
|
||||||
|
|
||||||
# do resampling with sox
|
# do resampling with sox
|
||||||
if [ $sox -ne 0 ]; then
|
if [ $sox -ne 0 ]; then
|
||||||
echo "wait, do resampling with sox..."
|
echo "wait, do resampling with sox..."
|
||||||
@ -397,6 +435,6 @@ for cue in ${NAME}*.cue; do
|
|||||||
if [ $blank -eq 1 ]; then
|
if [ $blank -eq 1 ]; then
|
||||||
cdrdao blank --reload $CDDEV --driver $CDDRV --blank-mode minimal
|
cdrdao blank --reload $CDDEV --driver $CDDRV --blank-mode minimal
|
||||||
fi
|
fi
|
||||||
cdrdao write --reload $CDDEV --driver $CDDRV $cue
|
cdrdao write $overburn --reload $CDDEV --driver $CDDRV $cue
|
||||||
done
|
done
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user