Correct avconv usage is:
avconv [global options] [input options] -i input [output options] output
You're putting all your options before your input, and so avconv is treating them all as input options. This would be better:
avconv -f video4linux2 -i /dev/video1 -s 640x480 -c:v libx264 -c:a ac3 test.mp4
The default settings may not be ideal for you; for libx264 you might want to set a -crf value (between 0 and 51, 23 is default, 18-28 is a sane range to use, lower=better quality, but bigger file) and a -preset (I normally use veryfast). For more information look here. Normally I'd recommend using VBR encoding for audio, but I don't really know about encoding AC3, so you may need to use a fixed bitrate (-b:a 192k will probably be OK for stereo sound).
Also, resizing the video may not be necessary, only use
-s 640x480 if you need to shrink a larger input to that size.
As for viewing it as you're recording it, I can think of two solutions. The first is to simply open the file you are creating with your preferred video player software. This will mean a slight delay in viewing.
The second solution is to send a second output from avconv to stdout, and then use I/O redirection to input the information to a video player. This will be faster, but it will take about twice the processing power, since as it stands avconv can only do this by encoding a second time (this may change in the future).
avconv -f video4linux2 -i /dev/video1 -s 640x480 -c:v libx264 -c:a ac3 test.mp4 \
-s 640x480 -c:v libx264 -c:a ac3 -f mp4 - | vlc -
I'm using VLC as an example, but all the linux video players I know can do this. Since avconv normally determines what container format to use from the file extension, but
- (stdout) doesn't have one, so you have to declare the container format with