Your screen. Your subscription. Your ProMax. Start with a one-day trial ↗

Pro Max 4K OTT

How Ogg Opus trims the final decoded packet

An Ogg Opus stream can finish between codec-frame boundaries. Its final page’s granule position tells the reader how many decoded samples to retain, allowing the remaining tail to be discarded. A complete final packet can therefore produce more decoded samples than the intended audible ending without indicating that the stream contains unwanted extra programme material.

A useful support message. Say what happened, when it happened and which device/player you use. Pro Max 4K OTT, promax4k.tv.
A useful support message. Say what happened, when it happened and which device/player you use. Pro Max 4K OTT, promax4k.tv.

An Ogg Opus stream can finish between codec-frame boundaries. Its final page’s granule position tells the reader how many decoded samples to retain, allowing the remaining tail to be discarded. A complete final packet can therefore produce more decoded samples than the intended audible ending without indicating that the stream contains unwanted extra programme material.

Calculate the retained tail

Use an illustrative previous completed-page granule of 48,000 and a final granule of 48,500. Their difference says to retain 500 samples from the packets completed on the final page. If the simplified final page has one packet decoding to 960 samples, the other 460 samples are excluded. Preserve both granule positions when checking this calculation.

Apply the final-page context

RFC 7845 ties this treatment to the page carrying the end-of-stream flag and defines restrictions on valid boundaries. The discarded amount should not exceed the final packet’s decoded samples. It is not a general rule allowing arbitrary short granules on every page. A parser needs the page flags and surrounding completed-packet history, rather than a final integer detached from the stream.

Distinguish sample trimming from byte truncation

A deliberately trimmed audible tail can still come from a complete coded packet. A file cut off in the middle of its packet or page is a different structural failure. A maintainer should check complete packet delivery before comparing the signaled retained samples with decoder output. File size alone cannot say which of those two conditions occurred.

Report the ending as a boundary problem

For a repeatable tail discrepancy, preserve the final page metadata, calculated retained count and actual output interval from an appropriate authorized comparison. A viewer can note whether the final spoken word is missing, extra silence appears or playback ends cleanly at an unexpected displayed time. The arithmetic explains the format’s intended ending; it is not a hands-on test of a specific app. Avoid changing every track’s delay to compensate for a final-page handling error confined to one representation.

Sources & further reading

From the ProMax collection

Track position. Race-day decisions.

Pit strategy, traffic and the character of each circuit. Stock-car racing is more than the final lap.

NASCAR stock-car racing logo above a Pro Max app screen, with the promax4k.tv brand and WhatsApp contact.
Pit strategy, traffic and the character of each circuit. Stock-car racing is more than the final lap.

An evening worth making time for

Get the player ready.
We’ll help with the rest.

Install the player for your screen, then WhatsApp the ProMax team for a one-day free trial. Already watching? Open the help desk for your next step.

Ask ProMax↑