pkgsrc/sysutils/mencvcd/patches/patch-aa
rillig e076cfff07 Files from DISTDIR should not be copied with the -p option, since they
could be write-protected by file flags, which makes it difficult to
remove them with "make clean".

While here, replaced some custom code with things that have been added
to the pkgsrc infrastructure. This makes the Makefile a bit shorter.
2007-11-01 08:34:42 +00:00

175 lines
5.1 KiB
Text

$NetBSD: patch-aa,v 1.3 2007/11/01 08:34:43 rillig Exp $
--- mencvcd.orig 2003-06-13 21:06:02.000000000 +0100
+++ mencvcd 2005-02-02 08:20:24.000000000 +0000
@@ -23,7 +22,7 @@
exit 1
fi
done
-for exe in vcdimager lame cdrdao yuvdenoise sox toolame normalize; do
+for exe in vcdimager lame cdrdao sox toolame normalize; do
if [ -z "`which $exe`" ]; then
echo "WARNING: $exe is not found in your path $PATH!"
fi
@@ -85,9 +84,6 @@
TMPDIR="." # path to directory for creating temporary files, recommended 2-3GB space
-CDDRV="generic-mmc" # cdrdao: cdwriter driver
-CDDEV="--device 0,1,0" # or comment out and create link /dev/cdrecorder
- # to your cdwriter dev
CDMAXSIZE=800
################################################################################
@@ -127,6 +123,7 @@
echo "-noburn disables burning."
echo "-normalize use 'normalize'."
echo "-overburn enables overburning a cd."
+ echo "-qmat <name> quantisation matrix for mpeg2enc"
echo "-pulldown enable pulldown mode in output."
echo "-ratio <s> output ratio size of frames, see yuvscaler (1)."
echo "-size <X>x<Y> sets output size of frames."
@@ -186,7 +183,7 @@
exit 1
;;
*)
- NAME=$1
+ NAME="$1"
shift 1
;;
esac
@@ -217,9 +214,9 @@
asr=44100
vbr=1152
vbrset=0
-denoise="cat -"
+denoise=""
vcdnorm="VCD"
-mplexnorm="-f $VCDMODE -m 1 -V -b 46"
+mplexnorm="-f $VCDMODE -V -b 46"
imaget="-t vcd2"
tvnorm=""
framerate=""
@@ -230,6 +227,7 @@
overburn=""
pd=""
normalize=0
+qmat="-K kvcd"
while [ "$1"x != "x" ]; do
case $1 in
@@ -296,6 +294,10 @@
-normalize)
normalize=1
;;
+ -qmat)
+ qmat="-K $2"
+ shift 1
+ ;;
-tvnorm)
tvnorm="-n $2"
shift 1
@@ -305,7 +307,7 @@
shift 1
;;
-denoise)
- denoise="yuvdenoise"
+ denoise="-vf denoise3d"
;;
-ratio)
ratio=$2
@@ -349,7 +351,7 @@
mpegnorm="-f $VCDMODE -b $vbr -B 260 -V 46"
if [ "$vcdnorm" == "SVCD" ]; then
[ $vbrset -eq 0 ] && vbr=2500
- mplexnorm="-f $SVCDMODE -m 2 -V -b 230"
+ mplexnorm="-f $SVCDMODE -V -b 230"
mpegnorm="-f $SVCDMODE -b $vbr -B 260 -V 230"
imaget="-t svcd"
fi
@@ -381,10 +383,9 @@
$command &
# mjpegtools
- ($denoise < $VIDEO | \
- yuvscaler -v 0 $wide -O $vcdnorm $size $active $tvnorm | \
- mpeg2enc -v 0 -s $mpegnorm $aratio -S $CDMAXSIZE -g 6 -G 15 -r 16 \
- $pd $framerate $tvnorm -4 2 -2 1 -o $NAME.mpv) &
+ (yuvscaler -v 0 $wide -O $vcdnorm $size $active $tvnorm < $VIDEO |
+ mpeg2enc -v 0 $qmat -s $mpegnorm $aratio -S $CDMAXSIZE -g 6 -G 15 \
+ -r 16 $pd $framerate $tvnorm -4 2 -2 1 -o "$NAME.mpv") &
# wait for finishing the subprocesses
wait
@@ -395,23 +396,23 @@
# do resampling with sox
if [ $sox -ne 0 ]; then
echo "wait, do resampling with sox..."
- sox $AUDIO -v $volume -r $asr $NAME.wav resample -qs
- mv -f $NAME.wav $AUDIO
+ sox $AUDIO -v $volume -r $asr "$NAME.wav" resample -qs
+ mv -f "$NAME.wav" $AUDIO
fi
if [ $toolame -ne 0 -a $mp3 -eq 0 ]; then
# do mp2 encoding with toolame
echo "wait, encoding to mp2 audio with toolame..."
toolame -b $abr $AUDIO
- mv -f `basename $AUDIO .wav`.mp2 $NAME.mpa
+ mv -f `basename $AUDIO .wav`.mp2 "$NAME.mpa"
elif [ $toolame -eq 0 -a $mp3 -eq 0 ]; then
# mp2enc/lame can't read audiodump.wav directly from named pipe,
# we have to read the whole file.
echo "wait, encoding to mp2 audio with mp2enc..."
- mp2enc -b $abr -r $asr -o $NAME.mpa < $AUDIO
+ mp2enc -b $abr -r $asr -o "$NAME.mpa" < $AUDIO
elif [ $mp3 -ne 0 ]; then
echo "wait, encoding to mp3 audio with lame..."
- lame -b $abr --resample $kasr - $NAME.mpa < $AUDIO
+ lame -b $abr --resample $kasr - "$NAME.mpa" < $AUDIO
fi
fi
@@ -419,9 +420,9 @@
rm -f $AUDIO
# multiplex streams
- [ -f $NAME.mpv -a -f $NAME.mpa ] || exit 1
- rm -f ${NAME}*.mpg
- mplex -v 0 $mplexnorm $sync -o ${NAME}%d.mpg $NAME.mpv $NAME.mpa
+ [ -f "$NAME.mpv" -a -f "$NAME.mpa" ] || exit 1
+ rm -f "${NAME}*.mpg"
+ mplex -v 0 $mplexnorm $sync -o "${NAME}%d.mpg" "$NAME.mpv" "$NAME.mpa"
# remove pipe, won't need anymore!
rm -f $VIDEO
@@ -430,7 +431,7 @@
[ $mpgonly -eq 1 ] && exit 0
# create cd images
- for mpg in ${NAME}*.mpg; do
+ for mpg in "${NAME}*.mpg"; do
[ -f $mpg ] || exit 1
cue="`basename $mpg .mpg`.cue"
bin="`basename $mpg .mpg`.bin"
@@ -444,7 +445,7 @@
# burn the svcds
[ $burn -eq 0 ] && exit 0
-for cue in ${NAME}*.cue; do
+for cue in "${NAME}*.cue"; do
bin="`basename $cue .cue`.bin"
[ -f $bin -a -f $cue ] || exit 1
@@ -452,9 +453,9 @@
read -n 1 i
if [ $blank -eq 1 ]; then
- cdrdao blank --reload $CDDEV --driver $CDDRV --blank-mode minimal
+ cdrdao blank --reload --blank-mode minimal
fi
- cdrdao write $overburn --reload $CDDEV --driver $CDDRV $cue
+ cdrdao write $overburn --reload $cue
done
exit 0