Wi-Fi Display technology in wireless screen projection
Wi-Fi Display is also commonly known as Wi-Fi Direct Display or WFD. It is a standard based on Wi-Fi technology carefully developed by the WiFi Wireless Industry Alliance. Its core goal is to build a reliable and peer-to-peer (P2P) HD video and audio streaming transmission bridge between wireless devices and HD displays. The birth of this technology allows users to completely get rid of the constraints of cumbersome physical connection cables, and can easily mirror the rich and colorful audio and video content on mobile devices to the big screen in real time, and enjoy the shocking visual experience brought by high-definition images.
I. Wi-Fi Display Technology Architecture
1. Overall Architecture Model
(1) Wi-Fi Display is based on end-to-end direct connection mode, and its architecture includes the following core components:
(2) Transmitter (Source): mobile phones, PCs and other devices, responsible for screen content acquisition, encoding and transmission.
(3) Receiver (Sink): TVs, projectors and other devices, responsible for data reception, decoding and display.
(4) Connection management layer: implements functions such as device discovery, security authentication, and session management.
Protocol stack layering
Layers |
Functions |
Protocol/Technology |
Application layer |
Screen capture, encoding, audio and video synchronization |
H.264/H.265, AAC/LPCM |
Transport layer |
Real-time data transmission and flow control |
RTP/RTCP, UDP |
Network layer |
IP addressing and routing |
IPv4/IPv6 |
Data link layer |
Point-to-point connection and frame transmission |
Wi-Fi Direct (802.11n/ac/ax) |
Physical layer |
Wireless signal modulation and transmission |
OFDM, MIMO, QAM modulation |
Ⅱ. Core Technology Principles
1. Wi-Fi Direct: The cornerstone of point-to-point connection
(1) Wi-Fi Display relies on Wi-Fi Direct (P2P mode) to establish direct communication. Its key technologies include:
(2) Soft AP mode: The sender simulates the router function and creates a temporary wireless network for the receiver to access.
(3) Channel negotiation: Automatically select the frequency band with the least interference (preferentially 5GHz), supporting 20/40/80MHz channel bandwidth.
(4) Energy-saving mechanism: Reduce standby power consumption through TDLS (Tunneled Direct Link Setup).
2. Efficient encoding and transmission
Video encoding process
(1) Frame capture: Capture screen frames (RGB or YUV format) at a rate of 60fps.
(2) Preprocessing: Denoising, color space conversion (RGB→YUV420).
(3) H.264 encoding:
Frame type classification: I frame (key frame), P frame (forward prediction), B frame (bidirectional prediction).
Macroblock segmentation: Divide the picture into 16×16 macroblocks, and perform motion estimation and compensation independently.
Quantization and entropy coding: Compress data through CABAC, with a compression ratio of up to 100:1.
Audio coding
(1) Sampling and compression: 48kHz sampling rate, AAC-LC encoding (128kbps bit rate).
Synchronization mechanism: Use RTP timestamp (Timestamp) and RTCP feedback to achieve audio and video alignment
3. Real-time Transport Protocol (RTP/RTCP)
(1) RTP Packet
(2) Header field: Sequence Number, timestamp, SSRC.
(3) RTCP feedback: The receiver periodically sends RR (Receiver Report), which contains network status information such as packet loss rate and delay.
Ⅲ. Detailed explanation of the workflow
1. Device discovery and connection establishment
Step 1 |
Broadcast Beacon Frame: The receiver periodically sends Beacon frames, declaring itself as a "Miracast Sink", which contains information such as device name and supported resolution. |
Step 2 |
P2P networking: After the sender scans the receiver, it completes security authentication through WPS (Wi-Fi Protected Setup) or PIN code to establish a Wi-Fi Direct connection. |
Step 3 |
Capability negotiation: Use the RTSP protocol to exchange media parameters. |
2. Data transmission and optimization
Dynamic bit rate adjustment (ABR):
(1) Dynamically adjust encoding parameters according to the packet loss rate fed back by RTCP:
Packet loss rate < 2%: maintain 1080p@60Hz, bit rate 20Mbps.
Packet loss rate 2%~5%: reduce to 720p@30Hz, bit rate 10Mbps.
Packet loss rate > 5%: switch to 5GHz band or enable FEC.
Anti-interference technology:
(1)MIMO multi-antenna: improve throughput through spatial streams.
(2)Forward error correction (FEC): add RS code or LDPC code to recover up to 30% of packet loss.
3. Receiver processing
(1)Decoding pipeline:
Jitter Buffer: cache 50-100ms data to eliminate the impact of network jitter.
H.264 hard decoding: use GPU or dedicated ASIC chip (such as ARM Mali-V61).
Post-processing: Deblocking Filter, color enhancement.
(2) Low latency mode:
Shorten GOP (Group of Pictures) to 2-4 frames.
Disable B frames, use only I and P frames.