opencv encode

We are trying to devleop an application that’s two fold. One is a service(written in C++) on a server which reads a camera feed and uses opencv and filters to process it. Currently, we are saving the feeds as .wmv files. We can stream them using any of the streaming servers available. We are looking a way to stream ths processed video from the service before writing it to a file and streaming it on-demand…i.e. in real time. Does anyone has any experience doing this or any ideas that I can use? Thanks for any help