#!/bin/bash

IN=-
OUT=`mktemp /tmp/streamdev-remux-XXXXXX`
rm -f $OUT.avi /tmp/$OUT.log
/usr/bin/mkfifo $OUT.avi

cat $OUT.avi & /usr/bin/mencoder "$IN" -cache 1024 -srate 44100 -oac mp3lame -lameopts vbr=0:br=128 -af volnorm -ovc lavc \
-lavcopts vcodec=mpeg4:vbitrate=600 -vf-add scale=400:240 -ofps 23.976 -ffourcc DIVX -noidx -o $OUT.avi &>$OUT.log

rm -f $OUT.avi /tmp/$OUT.log

