Install:

1. copy stream_sharedmem.c to stream/stream_sharedmem.c
2. copy video2mem/* to TOOLS/video2mem/*
3. patch -p0 -i cctv-sharedmem.patch

Configure:

./configure --enable-sharedmem [options]

Build:

make
cd TOOLS/video2mem
make

Usage example:

mencoder tv:// -tv device=/dev/video0:width=720:height=576 [options] -smemid 1001 &
mencoder tv:// -tv device=/dev/video1:width=720:height=576 [options] -smemid 1002 &
mencoder tv:// -tv device=/dev/video2:width=720:height=576 [options] -smemid 1003 &
mencoder tv:// -tv device=/dev/video3:width=720:height=576 [options] -smemid 1004 &

mplayer { smem://1001 smem://1002 smem://1003 smem://1001,1002,1003,1004 -vf scale=360:288,tile=2:2 -fps 100 } -loop 0 -rawvideo w=720:h=576:fps=25
