#!/bin/bash SRC=$1 HEAD=${SRC%%.*} START=$(pwd) WORK=/tmp/$(basename $0)-$$ [ -r $HEAD.vcd ] && exit mkdir $WORK cd $WORK mkfifo stream.yuv yuvscaler -v0 -O VCD -nn < stream.yuv | mpeg2enc -f1 -nn -F4 -M3 -o $HEAD.m1v & mkfifo audiodump.wav mp2enc -V -o $HEAD.mp2 < audiodump.wav & mplayer -quiet -vo yuv4mpeg -ao pcm $START/$SRC mplex -f1 $HEAD.mp2 $HEAD.m1v -o $START/$HEAD.vcd cd $START rm -r $WORK