Good software DVD to avi or mpg



I would like to put some favorite movies on my PC to use with my digital music server to my home theater system.

Best files to use would be avi and mpeg.

What would be a good program to make a DVD into a single avi or mpeg file, with adjustments to the recorded program, like bit rate and size of file?

Preferrably freeware.