# A Novel Video Transmission Latency Measurement Method for Intelligent Cloud Computing
## 3 Methodology
### Method 3: Lossless Remote Video Online Measurement  
When using Method 2 for measurement, both the sender and the receiver must have GPS signals and the measurement accuracy is low. For this reason, we developed a method that can accurately measure the end-to-end latency of remote video without loss based on the IEEE1588 time synchronization protocol. The measurement scheme is shown in Figure 5.  
A latency measurement device is placed at the transmitter and receiver of the remote video transmission system, respectively, and the device uses the built-in IEEE1588 protocol to achieve time synchronization. The original video and the reconstructed video are copied and connected to the transmitter latency measurement device and the receiver latency measurement device, and no changes are made to the video transmission system. The sending-end latency measuring device calculates the hash value of each input frame and combines it with the entry time of the frame to package and send it to the receiving-end latency measuring device through the network. The latency measurement device at the receiving end calculates the hash value according to the same algorithm for each frame of the reconstructed video and stamps it with a time stamp. At the receiving end, the latency measurement device matches the hash value of the original video frame and the hash value of the reconstructed video frame, and a successful hash value matching indicates that the corresponding frame is determined. The end-to-end latency of the frame can be obtained by comparing the timestamps of the corresponding frames. In order to accurately find the correspondence between the reconstructed video and each frame of the original video, this method uses video-aware hashing technology, which includes three processing contents: feature information extraction, video-aware hash extraction, and hash code matching. Most video codecs based on hybrid coding frameworks use motion search for predictive coding, therefore, this method selects motion information features of video frames as hash feature information to reflect changes in video content. Different from the commonly used video-aware hashing algorithm based on gradient orientation centroids, this method chooses to use a difference-valued hash-aware compression algorithm. In order to ensure the accuracy of the measurement, the measuring device at the sending end and the measuring device at the receiving end must maintain time synchronization. In order to ensure the accuracy of the measurement, the measuring device at the sending end and the measuring device at the receiving end must maintain time synchronization. We adopt the IEEE 1588 protocol and implement it in software, which can achieve a synchronization accuracy of 20 ns under a 100 ms synchronization period, which meets the requirements for accurate online measurement of video transmission delay [48]. The specific processing flow is shown in Figure 6.  
Figure 5: Lossless remote video online measurement scheme. Taking the original video sequence \(O_{n}(i,j)\) with a resolution of 1280 \(\times\) 720 as an example, the reconstructed video sequence after encoding and decoding is \(R_{m}(i,j)\), where \((i,j)\) represents the pixel coordinates in the video, n and m, respectively, represent the n and m frames of the original video and the reconstructed video. The luminance components \(Y_{On}(i,j)\) and \(Y_{Rm}(i,j)\) of the original video \(O_{n}(i,j)\) and the reconstructed video \(R_{m}(i,j)\) are selected for subsequent processing. The latency measurement devices at the sending end and at the receiving end record the input time of each frame of the original video and the reconstructed video. When the device detects the frame synchronization pulse of each frame, it records the value of the 32-bit counter driven by the internal 25 MHz clock as the time stamp of the frame input to the latency measurement device. The time represented by the counter is guaranteed to be synchronized by the IEEE1588 protocol inside the sender and receiver devices.