views:

756

answers:

2

Hi,

I've set up a custom tcp connection between my client and the server. I'm making a simple chat program. So far the users are able to talk to each other and send files. I'm adding a webcam chat and I've used AForge.Net for grabbing the frames from my webcam. But sending these captured frames from the client to the server is taking too long and uses up too much bandwidth. the server is receiving about 1 frame every 2~4 seconds.

I've tried using a Jpeg encoder and setting the quality to 30 but that doesn't improve anything

Do you guys know a good way of encoding a webcam stream for sending to a server?

Cheers Roman

+1  A: 

You need to send the webcam content as a video stream, not a series of images. I would recommend H264 as it's compact and is the most common video codec used on the web today. Encoding, streaming, receiving, and displaying the video is not simple though. There are plenty of open source projects that can help like X264 and VLC, but this is definitely a lot more complicated than grabbing jpgs and sending them. It would be a lot easier to use an existing video chat component that supports webcams.

Flash apps with an RTMP server can support webcams and there are many open-source/free RTMP servers available (I'm not 100% they support live webcam streams though--the commercial Adobe Flash Media Server definitely does). A Flash video component can be integrated into another app, either windows or web.

Sam
I'm not interested in using a RTMP server. I'm more interested in the learning curve.I've seen a few encoder examples for C# but I'm not sure how i can detect when the stream is written to so i can send that newly added encoded frame over my socket connection to the server...
Smartie
A: 

Sam, could you please provide us with link to the

existing video chat component that supports webcams ?

FreeBrainz