How to encode video packet using video/avc encoder in android live streaming?

How to encode raw video packet into RTCP and RTP packet from android camera live streaming using video/avc encoder and send those packet to another device using UDP socket?