Version 2.0
- client.py and server.py are the two main files for sender and receiver (py3 compatible).
- Check the address and port configuraion in config.conf before running.
- Run it as follows:
python server.py
python client.py
High-resolution real-time video transmission based on UDP protocol: Play video or capture the camera image from one computer to another computer in the same LAN. Try to make the video as high as possible while ensuring the highest possible resolution. Caton.
The transmission video can take the form of a picture or a stream, and the project takes the form of transmitting pictures, and displays multiple pictures within 1 s through the visual persistence effect to form a continuous video picture.
Laptop's camera (720p)
"007: Spectra" (Bluray@720p)
"Alien: Contract" (Bluray@1080p).
The basis of video transmission is the UDP transport protocol, which is an important type in the TCP/IP protocol.
The ACK command sent by the receiving end to the transmitting end controls the transmission process of the transmitting end, thereby ensuring the effect of the video playback at the receiving end (the ACK information of the receiving end is sent based on the TCP protocol)
Use Python's Socket to capture the video of the camera using Opencv.
Since the original captured image is large, even if it is directly compressed into the jpg format, its size is too large. UDP can only transmit a data area of 65535 bytes in size. Therefore, it is necessary to block and number the pictures, and compress the image data after the blocks into a jpg format.
Used by the receiving end, each thread is a socket, and the received data is stored in the data slice pool.
Another thread on the receiving end, used to repeatedly read the data slice from the data slice pool, and update the screen according to the number of the data slice (the screen is an array dedicated to image display). The updated results are temporarily stored in the image pool
The main thread of the receiving end repeatedly reads the picture from the picture pool and displays it.