After lots of trials and errors, found: to capture from webcam:
To get a video:
mencoder -fps 6 tv:// -tv driver=v4l:width=320:height=240:\ fps=6:device=/dev/video0:hue=-40:saturation=-40:contrast=-40 \ -ovc lavc -o test.mpg
To view the result:
mplayer -fps 3 test.mpg
I still have to find how to set correct fps on input and output, and to tune brightness parameters.