#!/bin/bash if [ ! "$5" ] then echo 'Use: rawdiff.sh [mul] [playback opts]' exit 1 fi I1="$1" I2="$2" W="$3" H="$4" FPS="$5" OPTS="$7" if [ "$6" ] then MUL="$6" else MUL="1" fi mkfifo i1 i2 o # Set up the inputs mencoder "$I1" -vf format=rgb24 -nosound -ovc raw -of rawvideo -o i1 & mencoder "$I2" -vf format=rgb24 -nosound -ovc raw -of rawvideo -o i2 & # And the output ./rawdiff i1 i2 o "$MUL" & # Then play it mplayer o -demuxer rawvideo -rawvideo format=rgb24:w="$W":h="$H":fps="$FPS" $OPTS # And get rid of stragglers kill %1 kill %2 wait