7

I'm adding a chat functionality to one of our softwares, I've got the chat functionality up and running using WCF. I'm thinking of trying to add a video chat functionality again using WCF, basically instead of sending the clients messages I will send the video stream. I was wondering if anybody has done this with WCF? Is it very recommended to do this with WCF?

Also has anybody used (and recommends) any components (preferably open source) or libraries for video conferencing in .NET 4. Thanks for any help.

Mohammad Sepahvand
  • 17,364
  • 22
  • 81
  • 122
  • Use the Microsoft Netmeeting control, which can do video conferencing. – Ben Apr 27 '12 at 15:49
  • 1
    Ouch, it uses H323 which is extremele problematic for firewalls - püretty much not supported (binary coding, need to decode all messages to know which ports to open). SIP is "standard" these days outside video conferencing (text based protocol, easy to parse for knowing the ports). Netmeeting sadly is outdated. – TomTom Apr 30 '12 at 15:34
  • Mohammad, did you ever get video chat added to your project? – Nick Benedict Sep 17 '12 at 21:03
  • I did, our software was a silverlight application running on LAN so I stuck to netTcpBinding and it worked perfectly fine, though we didn't test it strenuously but when I did test it between 6 clients it worked fine, no noticeable lag as far as I recall. If you need ideas on how to architect your service have a look at my answer [here](http://stackoverflow.com/a/11598229/189756) for a voice chat app, the service method for the video is identical to this. You need to configure some socket level properties to enhance performance, and if you want to use it over HTTP then use a HTTP based binding. – Mohammad Sepahvand Sep 18 '12 at 06:05
  • @NickBenedict WCF 4.5 has been released, I've heard that it has built in support for UDP transport, so I guess WCF is a somewhat stronger candidate than before for this sort of thing, you can use a service operation like mine and try to use it along with UDP a binding. – Mohammad Sepahvand Sep 18 '12 at 06:07

1 Answers1

3

You could use the following approach:

  1. Use the avicap32.dll and COM-interop (or DirectShow.NET) to capture the webcam's video.

http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/7cd5e561-0e1e-46f7-92e0-800276ce9cf9

http://www.c-sharpcorner.com/uploadfile/yougerthen/integrate-the-web-webcam-functionality-using-C-Sharp-net-and-com-part-viii/

http://www.codeproject.com/Articles/7637/DirectX-Video-Stream-and-frame-capture

  1. Use streamed transfer to send the streams over WCF. Possible using IIS Live Smooth streaming:

http://learn.iis.net/page.aspx/620/getting-started-with-iis-live-smooth-streaming

Some components / libraries that allow you to capture video:

Christophe Geers
  • 8,564
  • 3
  • 37
  • 53
  • 3
    But note that this sucks efficiency wise. THis is pretty much excatl what WCF is NOT designed to do - RTP, RTSP are a lot better. THere are a ton of things getting in your way (jitter, blocks etc.) if you use TCP / HTTP based channels for some something time and timing critical. – TomTom Apr 30 '12 at 12:35
  • @TomTom +1 RTP is mentioned in another answer here http://stackoverflow.com/questions/1829269/efficient-way-to-send-images-via-wcf – Nick Ryan Apr 30 '12 at 13:25
  • Just to bump this up again, with the official release of WCF 4.5, which I understand has built in support for UDP, would this make WCF a slightly better candidate than before? – Mohammad Sepahvand Sep 17 '12 at 19:03
  • also try the iConf.NET Video Conferencing SDK by AVSPEED ( http://www.avspeed.com ) – G-Man Jan 07 '14 at 01:53