WebSocket transmits images and websocket transmits images.
At the beginning of this article, I wanted to develop a simple live video system. However, it is still difficult to use Html5 + WebSocket. This article only connects to the image collection> server and then pushes the server to the client. Use the Image Base64 string for transmission throughout the process (low efficiency)
Follow these steps:
1. Implement server: it consists of two parts: socket and WebSocket. As the main thread, socket is used to process image source upload requests and manage WebSocket sessions. When the socket receives an Image Upload request, the server automatically creates the WebSocket service for sending images. When the WebSocket sub-Service receives the Image Browsing request, it starts to send images to the client.
2. Image Source (CS/BS): this client is used to collect and upload images.
3. Client (CS/BS): this client is used to view images
The design diagram is as follows:
4. Project
Image Source |
|
|
|
Server |
|
|
|
Client 1 |
|
|
|
Client 2 |
|
|
|
|
|
|
|
5. Technologies Used
5.1 HTML5
5.2 SuperSocket, SuperWebSocket, WebSocket4Net
5.3 Camera_Net Library
The above uses continuous-> send-> receive-> refresh images to achieve simple live broadcast.
: Please specify the source for sharing. Thank you!
My mailbox: jingzhaozhang@outlook.com