Rip HD and Bly Ray so they can be played on PSP and PS3

How can I rip HD and Blu Ray disks to AVI and MP4. I am using a PS3 as a media extender and a PSP for trips.

Thanks