Format to view on iOS and PS3?
MP4 with AAC audio and h.264 video is definitely playable on the PS3, and since it's an extension of Apple's .mov files, it should work on all the iDevices too.

For maximum compatibility, use the h.264 'baseline' profile, and avoid AAC-HE.

Older devices (like some DVD players) may require XVID video and AC3 audio in an AVI container, but that won't apply to either the PS3 or iPad.