Update : Try this, precompose all the layers so you have only one layer remaining in the time-line.
Then resize your comp with even numbers only! (2,4,6...) in your height and width composition settings. Apply the same height and width to the layer's scale.
Now, it should go with the H264 codec as well.