Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Vanilagy/mediabunny/llms.txt
Use this file to discover all available pages before exploring further.
Target
The base class for targets, specifying where output files are written.Properties
Called each time data is written to the target. Will be called with the byte range into which data was written.
This callback is extremely chatty and gets called very frequently. Use it to track the size of the output file as it grows.
BufferTarget
A target that writes data directly into an ArrayBuffer in memory. Great for performance, but not suitable for very large files. The buffer will be available once the output has been finalized.Constructor
Properties
Stores the final output buffer. Until the output is finalized, this will be
null.Example
StreamTarget
This target writes data to aWritableStream, making it a general-purpose target for writing data anywhere. It is also compatible with FileSystemWritableFileStream for use with the File System Access API. The WritableStream can also apply backpressure, which will propagate to the output and throttle the encoders.
Constructor
The writable stream to write data to.
Optional configuration.
Options
When set to true, data created by the output will first be accumulated and only written out once it has reached sufficient size, using a default chunk size of 16 MiB. This is useful for reducing the total amount of writes, at the cost of latency.
When using
chunked: true, this specifies the maximum size of each chunk. Defaults to 16 MiB.StreamTargetChunk type
The operation type. Always
'write'. This ensures automatic compatibility with FileSystemWritableFileStream.The data to write.
The byte offset in the output file at which to write the data.
Example
FilePathTarget
A target that writes to a file at the specified path. Intended for server-side usage in Node, Bun, or Deno.Writing is chunked by default. The internally held file handle will be closed when
.finalize() or .cancel() are called on the corresponding Output.Constructor
The path to the file to write to.
Optional configuration. Same as
StreamTargetOptions.Options
When set to true, data created by the output will first be accumulated and only written out once it has reached sufficient size. Defaults to true for FilePathTarget.
The maximum size of each chunk. Defaults to 16 MiB.
Example
NullTarget
This target just discards all incoming data. It is useful for when you need anOutput but extract data from it differently, for example through format-specific callbacks (onMoof, onMdat, …) or encoder events.