Your real time requirement may lead you away from ffmpeg to webrtc and
or to html5.
ondello .. they have api
rather than going native and trying to get at the video stream or
getting at the framebuffer to acquire an xcopy of what is in the video
buffer, and to then duplicate the stream an manage a connection (socket or
chunked http), you may want to look at api type alternatives....