# Keyframe Insertion: Enabling Low-Latency Random Access and Packet Loss Repair
## 5 Example Application  
To give a concrete example illustrating the possible workings of the proposed technique, the use case of live Over-The-Top (OTT) video streaming will be described. Imagine a live streaming service where different versions of a stream are generated to accommodate different devices and bandwidth constraints, i.e., the bitrate ladder. A companion stream is generated for every unique resolution present in the bitrate ladder of the live streaming solution. For this specific live stream, it is decided that a maximum random-access latency and packet loss recovery time of one second suffices. Therefore, these companion streams would consist of keyframes every second. Thanks to these companion streams, the keyframe period of the normal stream can be kept minimal, for example, 10 s. All streams will reside on the server until requested by end user devices. When a device connects, it requests the normal stream and the corresponding companion stream. The companion stream is closed after receiving a keyframe in the normal stream or the companion stream, whichever comes first. In this way, less than a second is needed to join the stream. After joining, less than 10 s of drift artifacts will be experienced corresponding to the measurements presented Table 2. Very specifically, assume that the normal stream (25 fps) and the companion stream are encoded with a QP of 27. Given a 10 s (250 frames) keyframe period in the normal stream, Table 3 recommends to encode the companion stream based on the normal stream, i.e., \(\text{KI}_{\text{NS}}\). This table informs us that on average only the first 15.8 frames have a superior quality when using the source sequence to encode the companion stream. Therefore, it can be safely assumed that after 250 frames in total, the strategy of using the decoded normal stream is most optimal. With this information, Table 2 informs us that a 0.6 decrease in VMAF score will be experienced during less than 10 s. From all the tested sequences, the worst-case reduction in quality during these first seconds was 4.31 VMAF points. When experiencing a packet loss, the end user device performs regular error concealment and immediately joins the companion stream. Again, the companion stream is closed  
Figure 8: Frames of the _BQSquare_-sequence with \(\text{QP}_{\text{NS}}=\text{QP}_{\text{CS}}=27\), which corresponds to the worst-case VMAF score decrease for those QP values. (**a**) The frame of \(\text{NS}_{\text{src}}\) without drift-error artifacts. (**b**) The frame of \(\text{KI}_{\text{src}}\) with drift-error artifacts. (**c**) The differences between subfigures (**a,b**). It is recommended to view these images in color, digitally. after receiving a keyframe in the normal stream or the companion stream, whichever comes first. Finally, it has to be taken into account that in the normal stream there is only one keyframe every 10 s rather than every second. For the provided settings, Table 1 provides an average factor of 13.9 size increase of a keyframe compared to a predicted frame. A rough estimate based on these numbers tells us that end user devices with reliable connections can enjoy a bitrate reduction in the range of 69% compared to classical streams with a keyframe period of one second and no companion stream configuration. \[\frac{(13.9+249)}{(10\times 13.9+240)}=0.69\]  
In the most extreme example for this application, this also implies that if an end user device would cope with at least one packet loss every second (\(\frac{1}{25/ps}=4\%\) or more loss rate), the bitrate of the stream for this end-user device would have to increase with 45%, i.e., \(\frac{1}{0.69}\), compared to the normal stream alone. With the proposed system, this bitrate increase for individual users linearly reduces with a reduction in loss rate. When alternatively tuning the system to the worst performers and giving everyone a stream with keyframe period of a second, everyone would suffer the 45% bitrate increase.