#!/bin/sh

echo "you have choosen to make a VCD compliant MPEG stream"
echo "please notice that VBR MPEG streams can have the same"
echo "visual quality with lower/low bitrates too (like divx)"
echo ""

nuvplay -e $1.nuv | toolame -s 44100 -b 224 -p 2 -m s /dev/stdin $1.mp2
exportvideo $1.nuv "|mpeg2enc -b 1152 -G 15 -g 15 -N -o $1.m1v"
mplex -f 1 -s 2324 -p 1 -o $1.mpg $1.m1v $1.mp2

echo ""
echo "Press enter for making a BIN and CUE file from your MPG file or"
echo "Ctrl-C if you want a VCD compliant MPG file only."
echo ""
read enter 

vcdimager -c $1.cue -b $1.bin $1.mpg

echo "you can burn your bin/cue files with cdrdao, simple change the
echo "device parameter to your cdwriter id and type"
echo ""
echo "cdrdao write --eject --device=0,3,0 $1.cue"
echo ""
echo "have fun"
