Using rtmp for live streaming

hi
i need example code for live streaming in (youtube/facebook) by using rtmp protocol

Not sure if you can use gstreamer.
You can give a try.