You’ve kinda answered your own question – DON’T use After Effects to output an H264! You will, undoubtedly, get quite a few answers along these lines…..
DON’T use After Effects to output an H264!
DON’T use After Effects to output an H264!
DON’T use After Effects to output an H264!
DON’T use After Effects to output an H264!
After Effects is not optimised for video compression – if you need a compressed video file, output from After Effects using one of the Lossless/uncompressed/non-temporally compressed formats such as ProRes 422 or Uncompressed 10-bit, then use one of the many compression programs to create your final, compressed movie.
So, make a lossless AVI render from After Effects (this shows that After Effects is rendering OK, it’s just the compression process that’s screwing things up) then you can try many different compression codecs/settings as you like in Apple Compressor, Cleaner, Adobe Media Encoder or whatever compression software you use, without having to go through the unnecessary step of re-rendering.
There are probably about 5 posts per week on this forum from people having problems outputting a render to H264 or some such codec. I wish Adobe would actually REMOVE the option to do so – it is a complete waste of time!
– Paul