I didn't try using encodebin element directly. Because I think in our situation, it would be better to make the pipeline fully under our control. There is high possibility that we will change how it works in the future. eg. we may replace h264parse with our own implementation like Rémi said, or something else. Anyway, I think using our own implemention is a future-proof.
Why, though? What control do we need, or might we need, that encodebin doesn't give us?
I don't know what the point of replacing h264parse is, but even if we did, that doesn't preclude using encodebin. If we want to change the H.264 data format manually, we can do that before even passing the data to GStreamer, or alternatively write our own GStreamer element.