Add maximumPageDuration Ogg muxer option (closes #277)

This commit is contained in:
Vanilagy
2026-01-13 13:37:34 +01:00
parent 571fbb3198
commit 2ab1be3834
4 changed files with 106 additions and 17 deletions
+3
View File
@@ -194,9 +194,12 @@ This format ensures [append-only writing](#append-only-writing).
The following options are available:
```ts
type OggOutputFormatOptions = {
maximumPageDuration?: number;
onPage?: (data: Uint8Array, position: number, source: MediaSource) => unknown;
};
```
- `maximumPageDuration`\
The maximum duration in seconds of each Ogg page. Pages will be flushed early if adding another packet would cause the page to exceed this duration. This is useful for streaming contexts where more frequent page output is desired. By default, pages are only flushed when they exceed a certain size.
- `onPage`\
Will be called for each finalized Ogg page of the output file. The [media source](./media-sources) backing the page's track (logical bitstream) is also passed.