22
CONFIDENTIAL
DOC-USR-0146-02
____________________________________________________________________________________
Z3 Technology, LLC
♦
100 N. 8th St. STE 250
♦
Lincoln, NE 68508-1369 USA
♦
+1.402.323.0702
5.12
Tuning for Latency
For latency, the key parameters to work with are Maximum Delay and Number of B-frames.
Maximum Delay defines the number of milliseconds of buffering the encoder has to work with. The
higher this value, the more buffering it has to work with and the more time it has to “smooth things out”
for challenging content. However, a higher value also causes latency to increase accordingly. To
minimize latency, this value should be set to the lowest possible value. The lowest value Z3 recommends
is 100.
B-frames improve the quality of the picture, but they also increase the latency by 1 frame time. To
minimize latency, B-frames should be disabled (done by setting “Number of B-frames” to 0).
In general, streaming using RTP will result in lower latency than streaming using TS. If low latency with
TS is desired, there is a special “TS lowlat mode” that can be activated. Setting this causes the TS muxer
to send packets out immediately rather than gathering data and sending packets once they reach
maximum network size. The tradeoff is less efficient use of the network and a TS stream that is no
longer perfectly smooth. Because of this lower efficiency, only streams up to 5Mbps are supported. The
user is encouraged to experiment with this to determine what tradeoff is best for them.
Figure
16
shows the suggested values for Maximum Delay and Number of B-frames for 3 common use
cases:
Maximum Delay
# of B-frames
Case 1: Highest Quality, Highest Latency
9999
2
Case 2: Good Quality, Standard Latency
2000
1
Case 3: Normal Quality, Lowest Latency
100
0
Figure 16 Tuning for Various Use Cases
GDR can also be used to reduce latency.
If you are streaming to VLC, you can reduce latency on the decode side by adjusting the network caching
value. By default, this is set to 1000ms. You can lower this to as low as 200ms. To do this, go to the
following:
VLC
→
Tools
→
Preferences
→
Show Settings (ALL)
→
Input / Codecs
→
Network caching (ms)