Efficient way to stream webcams from client to C # server

I established a tcp user connection between my client and server. I am doing a simple chat program. While users can talk to each other and send files. I add chat to my webcam, and I used AForge.Net to capture frames from my webcam. But sending these captured frames from the client to the server takes too much time and uses too much bandwidth. the server receives about 1 frame every 2 ~ 4 seconds.

I tried using a jpeg encoder and set the quality to 30, but it didn’t improve anything

Do you guys know a good way to encode a webcam stream to send to a server?

Greetings Roman

+3
source share
1 answer

You need to send the contents of the webcam as a video stream, not a series of images. I would recommend H264 as the compact and most common video codec used on the Internet today. However, encoding, streaming, receiving and displaying video is not easy. There are many open source projects that can help, for example, X264 and VLC, but it is definitely much more complicated than capturing jpg and sending them. It would be much easier to use an existing video chat component that supports webcams.

Flash- RTMP- -, RTMP- / ( 100% -, , , Adobe Flash Media Server). Flash- , Windows .

+1

Source: https://habr.com/ru/post/1731313/


All Articles