Welcome to the confusion that is MPEG 4! I have had problems with H.264 for a while related to CCTV systems. Basically MPEG 4 has lots of compatibility standards (called "part levels") which have encoding features that may or may not be used depending upon the developer of the codec. It can sometimes be very difficult to find a codec to play something back which was encoded with a different MPEG 4 codec. The main two are Part 2 (which includes codecs like DivX, Xvid and Quicktime 6) and Part 10 (which includes H.264, Quicktime 7, Blu-ray and the now discontinued HD-DVD).
One of the codecs which supports the most features is free and called x264 available
here. By 'free' I mean its released under the GNU General Public License although there seems to be some arguments over which countries the H.264 patent is enforceable making the GNU licensed codecs possibly illegal - but that's another discussion.

Chart data provided with kind permission from
ELSPA