top of page

What is Encoding Latency?

Oct 25
9 min read

Updated: Oct 27

Raw video frames passing through an encoder before leaving as a compressed media stream.

 

Encoding latency is the time taken for media supplied to an encoder to become available as compressed output. In video, a useful measurement boundary is the moment a frame enters the encoder to the moment its coded data returns. This can include waiting and internal buffering as well as processing, depending on the implementation and the metric being used.

 

It is one part of a live media journey. Camera capture, application queues, network delivery, decoding and display can add other delays. A fast broadband connection cannot make an encoder finish a frame sooner, and a fast encoder does not guarantee that the viewer receives it promptly.

 

Where encoding sits in the media path

 

An application obtains raw pictures, may resize or convert them, submits them to a video encoder, and passes the compressed output onward. The encoder represents those pictures using a chosen codec and its supported coding tools. A streaming application then needs further work to package or packetise and deliver that output.

 

Define the start and end points before comparing numbers. A measurement beginning at camera exposure answers a broader question than one beginning at encoder submission. A measurement ending when a network packet leaves the computer includes work after encoding. Calling all three “encoding latency” conceals the difference.

 

The W3C WebRTC statistics specification defines video encode time from feeding a frame to the encoder until encoded data for it returns. It explicitly excludes additional packetisation time. Its published statistics document is a Candidate Recommendation Draft, and individual fields are not guaranteed to be available in every browser and configuration.

 

What is Encoding Latency infographic explaining the mechanism, key stages and practical limits.

 

The infographic distinguishes the measurement boundary, the causes of waiting, and two different performance questions. Its queue and parallel-processing examples are invented models for understanding timing. They are not measurements or recommendations for any particular processor or encoder.

 

Why an encoder can add delay

 

An encoder is not simply a box that performs a fixed amount of arithmetic and immediately releases every picture. Its configuration may let it examine later input pictures, use temporal prediction or coordinate several frames in flight. Some waiting is therefore deliberate rather than evidence that the hardware is overloaded.

 

The NVIDIA Video Codec SDK 13.1 programming guide describes lookahead as buffering input pictures to estimate complexity and allocate bits. It also provides different tuning choices for different latency and quality goals. Those are implementation-specific capabilities, subject to the active hardware and software, rather than a timing promise for every graphics card.

 

A simplified path is:

 

  1. A frame becomes ready in the application and waits for any work ahead of it.

  2. The application submits it through the selected encoder interface.

  3. The implementation collects any additional input required by its configuration.

  4. Coding work runs using the available processing and memory resources.

  5. Dependencies and output-order rules determine when the coded result can be released.

  6. The application obtains the output and performs the subsequent packaging or transport work.

 

A measured interval can cover some or all of these stages. Write down which ones it includes. Do not add separate reported delays together if their measurement boundaries overlap.

 

Planned buffering and overload are different

 

Lookahead deliberately waits for information from later input. For scale, six frame periods at exactly 60 fps occupy 100 ms. That calculation describes a duration of input, not a universal prediction that every six-frame lookahead setting adds precisely 100 ms to a measured stream. Startup, parallel processing, internal scheduling and the encoder's definition all matter.

 

A queue caused by insufficient sustained processing capacity is a different problem. When work arrives faster than the system completes it, a queue can grow unless the application adapts, drops work or applies backpressure. Removing deliberate lookahead does not guarantee enough capacity for an otherwise excessive workload.

 

Picture dependencies also matter. Some coding structures use later pictures as references, while other low-delay structures avoid that particular future-picture dependency. The details vary by codec and encoder. It is too broad to claim that every B-picture has the same delay cost or that one setting is appropriate for every modern implementation.

 

Our keyframe interval guide explains a separate control: the spacing of suitable entry pictures. Making those entry points more frequent does not automatically remove lookahead, release queued work or reduce processing time.

 

Keep four observations separate when interpreting a delay:

 

  • Planned buffering waits for information the coding configuration needs.

  • Overload queueing means work is accumulating faster than it is completed.

  • Processing time covers work within the stated encoder boundary.

  • Downstream delivery and playback introduce delays beyond coded output.

 

Throughput is not the same as latency

 

Throughput describes completed work per unit time, such as encoded frames per second. Latency describes elapsed time for an individual item. A pipeline can work on several frames concurrently and achieve a high output rate while each frame still spends appreciable time inside it.

 

Imagine an ideal pipeline in which each frame takes 45 ms from admission to completion, but new frames can enter every 15 ms. Three successive frames enter at 0, 15 and 30 ms and finish at 45, 60 and 75 ms. The steady output spacing is 15 ms, equivalent to about 66.7 frames per second, while each frame's latency is still 45 ms.

 

This is why a claim that an encoder can sustain 60 fps does not prove its latency is below 16.7 ms. Nor does a single frame taking longer than one input period automatically prove overload in a parallel system. Examine sustained output, queue behaviour, dropped frames and the actual implementation together.

 

Techie Broadband example: a growing serial queue

 

Now consider a deliberately different model: one serial worker, no parallelism, no dropped frames, no other delays, and exactly 20 ms of service for every frame. Input arrives at 60 fps, approximately every 16.7 ms. The worker cannot keep up indefinitely because each job takes longer than the interval between jobs.

 

Frame

Arrival

Work starts

Output ready

A

0.0 ms

0.0 ms

20.0 ms

B

16.7 ms

20.0 ms

40.0 ms

C

33.3 ms

40.0 ms

60.0 ms

D

50.0 ms

60.0 ms

80.0 ms

E

66.7 ms

80.0 ms

100.0 ms

 

Frame A spends 20 ms in the system. Frame E spends approximately 33.3 ms, comprising about 13.3 ms waiting and 20 ms of service. Values in the table are rounded from the underlying 60 fps timing. The queue adds roughly 3.3 ms of waiting per successive frame in this short example.

 

Buying more upload capacity does not change that worker's service rate. A relevant remedy would have to change the workload, processing capacity or handling policy. A real encoder may use parallel stages and adaptive behaviour, so the example is a diagnostic model rather than a prediction of its exact queue.

 

Measure the same interval and the same object

 

For applications that expose suitable WebRTC video statistics, cumulative counters can provide an average encode time. Compare two snapshots of the same continuing outbound stream object. Subtract the earlier total encode time from the later one, then divide by the increase in successfully encoded frames.

 

Suppose totalEncodeTime rises from 8.0 to 8.9 seconds while framesEncoded rises from 1,000 to 1,100. The interval contains 0.9 accumulated seconds of encode time across 100 frames. Dividing gives 0.009 seconds, or 9 ms per encoded frame.

 

Counter

Earlier snapshot

Later snapshot

Increase

Total encode time

8.0 s

8.9 s

0.9 s

Frames encoded

1,000

1,100

100

 

This is a mean for those frames, not the worst frame, a percentile or the complete capture-to-display delay. It is also not evidence that 9 ms is an acceptable threshold for every application. Two sessions can have the same mean and very different occasional stalls.

 

Do not subtract across a reset, a replaced stream object or missing fields. If the frame count did not increase, there are no newly encoded frames to average using that calculation. Keep the units, object identifier, codec, output dimensions and frame rate with the result so a later comparison remains meaningful.

 

Our WebRTC explanation places those sender measurements alongside connectivity and receiver behaviour. A low sender encode average alone cannot certify the entire call.

 

What encoder settings change the trade-off?

 

Resolution, output frame rate, codec, preset, prediction structure and analysis features can affect the amount and scheduling of work. The effect is specific to the content and implementation. Preset names from one encoder are not interchangeable with those from another.

 

The x265 project's own preset documentation describes faster presets as trading compression efficiency for encoding speed. Its zerolatency tuning removes selected sources of buffering and frame parallelism. The name does not mean that physical processing takes zero time, and reducing parallelism can itself reduce throughput. Use that as an example of a trade-off, not as a command to copy into every application.

 

WebCodecs likewise distinguishes quality and realtime latency goals. Its realtime mode permits quality compromises and frame dropping to pursue timely output; it does not promise a universal millisecond limit. Hardware preferences in that API are hints, and the specification warns that acceleration does not simply imply lower latency in every situation.

 

Compare a representative scene, including motion and scene changes, before and after one supported adjustment. Judge output quality and stability alongside elapsed time. A setting that produces a smaller delay but unacceptable picture quality has not automatically improved the service for its intended use.

 

Hardware encoding still has a surrounding workload

 

A dedicated encoding engine can offload coding work, but the application may still need graphics processing, memory transfers, colour conversion, composition and access to shared resources. A supported codec and profile must also be available in the actual application, driver and device combination.

 

The OBS encoding performance guide discusses reducing output resolution, frame rate and scene complexity when resources are insufficient. This does not mean every stutter is caused by encoding. A scene that cannot be rendered on time presents a different boundary from a frame already submitted to the encoder.

 

Use the application's supported statistics to identify the stage that is falling behind. Overall CPU or GPU utilisation is useful context, but one percentage does not show every queue or specialised engine. Also distinguish an initial setup delay from sustained behaviour during a long session.

 

Separate encoding problems from broadband problems

 

A comparable local recording can help investigate whether visible disruption already exists before internet delivery. It is evidence with limits: recording and streaming may use different encoders, presets, storage paths or simultaneous outputs. Keep those differences visible rather than assuming the tests are identical.

 

For a UK broadcast or call, consider ISP, access network, product and location together with local Ethernet or WiFi and competing traffic. A connection that cannot deliver the coded stream reliably can introduce downstream problems even when encoding is timely. Conversely, changing broadband does not directly repair an overloaded local encoding stage.

 

Our upload speed guide explains the access-side rate measurement. Observe what happens during the affected activity, rather than treating an unrelated speed-test result as a measurement of encoding latency.

 

A practical checking sequence

 

  1. Define the symptom and measurement boundary: frame submission, coded output, network transmission or final display.

  2. Record the device, application version, codec, active encoder, output dimensions, frame rate and preset.

  3. Use supported statistics to distinguish capture or rendering problems, encoder delay, output buffering and network interruptions.

  4. Compare a representative quiet-device test with the affected workload, preserving the important output settings.

  5. Where supported, examine encode-time distributions or interval averages together with queue growth and skipped frames. Keep counter resets and missing values visible.

  6. Test one documented reduction in workload or buffering at a time, within the destination's requirements. Compare picture quality and sustained output as well as delay.

  7. Repeat the network-side comparison separately using a practical wired connection and comparable activity, avoiding disruption to essential sessions.

  8. Restore unsuccessful changes and escalate with timestamps, configuration and relevant measurements. Share logs through suitable support channels without exposing stream keys or private session information.

 

This sequence does not require changing firmware, disabling protections or buying hardware before the delayed stage is identified. It creates evidence that an application or network operator can use to investigate the relevant part of the path.

 

Frequently asked questions

 

What is encoding latency measured in?

 

It is usually expressed in milliseconds or seconds between defined input and output events. Always check the measurement boundary and whether the result is a mean, percentile or individual frame.

 

Does 60 fps mean encoding latency is under 16.7 ms?

 

No. A parallel pipeline can sustain that output rate while individual frames spend longer inside it. Throughput and elapsed time per frame are different measurements.

 

Does zerolatency tuning mean zero delay?

 

No. It is a name for configuration choices that remove particular sources of buffering. Processing, application scheduling and the rest of the media journey still take time.

 

Is hardware encoding always faster?

 

No universal latency result follows from the label alone. The device, supported configuration, workload, buffering and application implementation all matter.

 

Will faster broadband reduce encoding latency?

 

Not directly. It can improve delivery when the connection is the limiting stage, but it does not make the encoder complete its local processing sooner.

 

Can an average encode time hide stalls?

 

Yes. An average does not describe the worst frame or the distribution. Review it alongside queue behaviour, skipped frames and the timing of the actual symptom.

 

Key takeaway

 

Encoding latency is an elapsed-time measurement with a defined boundary. Identify deliberate buffering, workload and queueing separately, and distinguish an individual frame's delay from sustained output rate. Optimise the relevant stage with measured comparisons while preserving the quality and compatibility the application needs.

 

Explore the Techie Broadband terminology guide for the related media and network concepts.

 
 
UK Techie Broadband Providers
bottom of page