Package-level declarations
Types
A resource whose release may wait.
One decoded frame of an AsyncMediaRuntime. It is the suspending form of Frame. info was read when the frame was made. Everything that reads the frame's data waits for the lane.
Opens the other addresses that media read through an AsyncMediaByteSource refers to, such as the segments and keys of an HLS playlist. It is the suspending form of MediaByteOpener.
Media bytes from caller code that may answer later: a Fetch response, a network client, a cache. It is the suspending form of MediaByteSource, opened through AsyncMediaRuntime.open.
What a container says about itself, as one snapshot. It never changes: an operation that changes the container publishes a new snapshot in AsyncMediaSource.info.
Reads media whose bytes may answer later, from an AsyncMediaByteSource.
An open container of an AsyncMediaRuntime. It is the suspending form of MediaSource, and its members mean what the members of the same name mean there.
One packet of an AsyncMediaRuntime. It is the suspending form of Packet. Every property was read when the packet was made, so a getter never waits and never enters FFmpeg.
Reads the packets of an AsyncMediaSource. It is the suspending form of PacketReader. A source has one read position, so it has one open reader at a time.
Decodes the packets of one stream. It is the suspending form of StreamDecoder.
Decodes subtitle packets. It is the suspending form of SubtitleDecoder.
One configured and opened audio encoder. Some codecs require a fixed input chunk size (AAC: 1024 samples). For those, route frames through FilterGraph.buildAudio and call FilterGraph.setOutputFrameSize with frameSize (Transcoder does this automatically).
One configured and opened audio encoder. Some codecs require a fixed input chunk size (AAC: 1024 samples). For those, route frames through FilterGraph.buildAudio and call FilterGraph.setOutputFrameSize with frameSize (Transcoder does this automatically).
One configured and opened audio encoder. Some codecs require a fixed input chunk size (AAC: 1024 samples). For those, route frames through FilterGraph.buildAudio and call FilterGraph.setOutputFrameSize with frameSize (Transcoder does this automatically).
One configured and opened audio encoder. Some codecs require a fixed input chunk size (AAC: 1024 samples). For those, route frames through FilterGraph.buildAudio and call FilterGraph.setOutputFrameSize with frameSize (Transcoder does this automatically).
What an audio encoder writes: the format, the rate, the channels and the sample format. MediaSink.addAudioEncoder opens an encoder from it, and Transcoder.transcode takes one as its audio spec.
Per-input description for FilterGraph.buildAudioMulti.
What the container declares about an audio stream.
One container chapter, bounds in microseconds on the same ABSOLUTE timeline every other timestamp KiteFFmpeg reports uses (subtract MediaSource.startTimeMicros to move onto the relative timeline seeks accept).
Where a chroma sample sits relative to its luma samples. Values match FFmpeg's AVChromaLocation.
Turns the closed captions that video frames carry into timed text (#179): the bytes Frame.closedCaptions gives, three per caption pair, as broadcast H.264, HEVC and MPEG-2 carry them in the video stream itself. A caption track stored on its own, such as a MOV c608 track, is a subtitle stream instead and decodes through MediaSource.openSubtitleDecoder.
Turns the closed captions that video frames carry into timed text (#179): the bytes Frame.closedCaptions gives, three per caption pair, as broadcast H.264, HEVC and MPEG-2 carry them in the video stream itself. A caption track stored on its own, such as a MOV c608 track, is a subtitle stream instead and decodes through MediaSource.openSubtitleDecoder.
Turns the closed captions that video frames carry into timed text (#179): the bytes Frame.closedCaptions gives, three per caption pair, as broadcast H.264, HEVC and MPEG-2 carry them in the video stream itself. A caption track stored on its own, such as a MOV c608 track, is a subtitle stream instead and decodes through MediaSource.openSubtitleDecoder.
Turns the closed captions that video frames carry into timed text (#179): the bytes Frame.closedCaptions gives, three per caption pair, as broadcast H.264, HEVC and MPEG-2 carry them in the video stream itself. A caption track stored on its own, such as a MOV c608 track, is a subtitle stream instead and decodes through MediaSource.openSubtitleDecoder.
Turns the closed captions that video frames carry into timed text (#179): the bytes Frame.closedCaptions gives, three per caption pair, as broadcast H.264, HEVC and MPEG-2 carry them in the video stream itself. A caption track stored on its own, such as a MOV c608 track, is a subtitle stream instead and decodes through MediaSource.openSubtitleDecoder.
A bitstream format, by FFmpeg's codec name (h264, aac, av1): what a stream carries, whichever implementation wrote it or reads it. EncoderId and DecoderId name the implementations, and FFmpeg.codecOf, FFmpeg.encodersFor and FFmpeg.decodersFor map between the two.
The colour metadata a renderer must honour to draw a frame correctly.
The YCbCr to RGB matrix. Values match FFmpeg's AVColorSpace.
The colour primaries. Values match FFmpeg's AVColorPrimaries.
The transfer function, meaning the gamma curve. Values match FFmpeg's AVColorTransferCharacteristic.
An output stream fed by stream-copy. Opaque handle; packets flow through Remuxer/Transcoder.
An output stream fed by stream-copy. Opaque handle; packets flow through Remuxer/Transcoder.
An output stream fed by stream-copy. Opaque handle; packets flow through Remuxer/Transcoder.
An output stream fed by stream-copy. Opaque handle; packets flow through Remuxer/Transcoder.
What decoding does when FFmpeg reports damaged data.
The fields worth comparing: the ones a caller allocates against before decoding starts.
The brightness of a scene, as the RPU's level 1 metadata states it: the darkest, the average and the brightest level, each as a 12-bit PQ code. A tone mapper that knows the scene's peak can keep more of a dark scene than one that only knows the peak of the whole title.
The colour of the reshaped signal, FFmpeg's AVDOVIColorMetadata, which FFmpeg fills with its defaults when the RPU carries none of its own.
The Dolby Vision composition of one frame, which turns the base layer and its RPU into an ordinary HDR10 picture: 10-bit 4:2:0 in BT.2020 with the PQ curve, limited range, the source's range as its mastering display, and no Dolby Vision metadata left on it. Every renderer that can show HDR10 can then show it.
The Dolby Vision configuration record a stream declares, as the container's dvcC, dvvC or dvwC box, or Matroska's block addition mapping, carries it.
The reshaping of one component: a curve in pieces between pivots, each piece a polynomial or an MMR mapping, FFmpeg's AVDOVIReshapingCurve.
How an RPU maps each component of the base layer, FFmpeg's AVDOVIDataMapping.
The Dolby Vision metadata of one decoded frame, read from the RPU that FFmpeg's decoder parsed and attached to it.
The inverse quantization of one component, FFmpeg's AVDOVINLQParams.
The linear dead-zone inverse quantization that restores an enhancement layer's residual, the one method FFmpeg reads, from FFmpeg's AVDOVIDataMapping.
The mapping of one span of a DolbyVisionCurve.
The header of an RPU, FFmpeg's AVDOVIRpuDataHeader, each field under its name there. Its two ext_mapping_idc fields are left out, because nothing in FFmpeg but its RPU encoder reads them.
Where a container's length came from, as FFmpeg records it in AVFormatContext.duration_estimation_method. See MediaSource.durationOrigin.
One encoder, by its FFmpeg name (libx264, h264_videotoolbox, aac): an implementation that produces a CodecId. FFmpeg.codecOf says which format, and FFmpeg.encodersFor lists the encoders a build has for a format.
What a FilterGraph.feedInput or FilterGraph.flushInput call produced, and what the graph needs next.
Static facade for global FFmpeg state: version info, build flags and capability probing.
Static facade for global FFmpeg state: version info, build flags and capability probing.
Static facade for global FFmpeg state: version info, build flags and capability probing.
Static facade for global FFmpeg state: version info, build flags and capability probing.
The real web backend, over the generated binding.
A family of FFmpeg components that FFmpeg.components lists.
Every KiteFFmpeg failure surfaces as FFmpegException wrapping a typed FFmpegError.
The FFmpeg identity report: what this build was compiled against, what it is linked to, and whether the two are compatible.
How severe an FFmpeg log line is, from the most severe to the least.
One line FFmpeg logged, as FFmpegException.logged keeps it (#170).
Receives FFmpeg's own log lines, as installed with FFmpeg.setLogSink.
How a video stream's fields are ordered, in DISPLAY order.
A compiled libavfilter graph. Build with FilterGraph.buildVideo / FilterGraph.buildAudio (single input) or buildVideoMulti / buildAudioMulti (N inputs: overlay, amix, โฆ). Feed frames through process (single input) or feedInput (any input). Close it when done. feedInput and flushInput answer with a FeedResult, which names the input a graph with several inputs waits for.
One decoded frame (video or audio), backed by an opaque native owner. Close it to release the buffers.
One decoded frame (video or audio), backed by an opaque native owner. Close it to release the buffers.
One decoded or constructed picture or block of audio, held in native memory. Read it through info and copyPlanesToByteArray, and close it when done.
One decoded frame (video or audio), backed by an opaque native owner. Close it to release the buffers.
A decoded frame, as a handle into the codec module.
Immutable per-frame metadata snapshot: no native handle, safe to hold forever.
A hardware acceleration a decoder can be opened with.
The static HDR metadata a stream carries beside its colour tags. A tone mapper uses it to learn how bright the content and the display it was graded on actually were, instead of assuming.
Marks API that hands out opaque native-backed owners, manual lifetimes, or a stage of the pipeline that the caller must drive itself.
Loads the codec, which on the web is a separate wasm module fetched over the network.
A luminance range in candelas per square metre.
The mastering display an HDR stream was graded on, as SMPTE ST 2086 describes it. Either half may be missing, because a stream may declare one without the other.
One ChapterAtom.
One EditionEntry: a set of chapters, such as one cut of a film.
What a Matroska file says about its own segment, its editions and their chapters, read as RFC 9559 defines them (#173).
What a chapter is, from its ChapterSkipType, so that a player can offer to skip it.
Opens the other addresses that media read through a MediaByteSource refers to.
Where an output's bytes go instead of a path: the custom I/O door for writing, and the output half of MediaByteSource. An in-memory buffer, encrypted storage, a virtual file system or an upload stream takes the bytes a muxer writes, through MediaSink.open.
Media bytes from caller code instead of a path: the custom I/O door. A player streams through its own HTTP client with its own TLS and auth, reads from an encrypted store, a torrent, a cache, or a byte array it already holds, and FFmpeg demuxes those bytes exactly as it would a file's.
The container-level facts in one value: what a player's media screen shows before any stream is selected. Assembled from the source's own members, so it can never disagree with them.
Everything a container says about itself, read in one call and with nothing left open.
An open output file (muxer). Add every encoder first, video and audio, because the muxer's header freezes the stream list. Then push frames through the encoders. Close the sink to write the trailer and flush buffers.
An open output file (muxer). Add every encoder first, video and audio, because the muxer's header freezes the stream list. Then push frames through the encoders. Close the sink to write the trailer and flush buffers.
An open output file (muxer). Add every encoder first, video and audio, because the muxer's header freezes the stream list. Then push frames through the encoders. Close the sink to write the trailer and flush buffers.
An open output file (muxer). Add every encoder first, video and audio, because the muxer's header freezes the stream list. Then push frames through the encoders. Close the sink to write the trailer and flush buffers.
An opened input: a local file or a URL. It owns the container cursor and per-stream resources, and closing it releases them all. Confine it to one coroutine context, because the underlying media objects are not safe to call concurrently.
An opened input: a local file or a URL. It owns the container cursor and per-stream resources, and closing it releases them all. Confine it to one coroutine context, because the underlying media objects are not safe to call concurrently.
An opened input: a local file or a URL. It owns the container cursor and per-stream resources, and closing it releases them all. Confine it to one coroutine context, because the underlying media objects are not safe to call concurrently.
An opened input: a local file or a URL. It owns the container cursor and per-stream resources, and closing it releases them all. Confine it to one coroutine context, because the underlying media objects are not safe to call concurrently.
An open container, over the codec module.
A cancel request that can reach MediaSource.open while it runs.
A demuxed packet the caller owns.
A demuxed packet the caller owns.
A demuxed packet the caller owns.
A demuxed packet the caller owns.
A demuxed packet the caller owns.
Reads owned packets from one MediaSource cursor under the caller's control. This is the demuxing half of a player, kept separate from decoding so audio and video decoding can proceed independently and a seek can replace the caller's queued generation explicitly.
Reads owned packets from one MediaSource cursor under the caller's control. This is the demuxing half of a player, kept separate from decoding so audio and video decoding can proceed independently and a seek can replace the caller's queued generation explicitly.
Reads packets from a container, one at a time, under the caller's control.
Reads owned packets from one MediaSource cursor under the caller's control. This is the demuxing half of a player, kept separate from decoding so audio and video decoding can proceed independently and a seek can replace the caller's queued generation explicitly.
Reads owned packets from one MediaSource cursor under the caller's control. This is the demuxing half of a player, kept separate from decoding so audio and video decoding can proceed independently and a seek can replace the caller's queued generation explicitly.
The pixel format of a video frame, named exactly as FFmpeg names it (yuv420p, nv12, โฆ). The platform bridge translates the name to an AV_PIX_FMT_* value.
FFmpeg's AVRational: an exact fraction. Use it for time-bases, frame rates and aspect ratios. Float conversion is lossy; do all arithmetic on the rational form when possible.
Lossless container rewrite: ffmpeg -c copy. Packets move from input to output without touching a decoder or encoder, so a full-length movie remuxes in seconds and bit-exact quality is preserved. Use it to change containers (mp4 โ mkv), strip streams, cut on keyframes, or re-wrap after a download.
Lossless container rewrite: ffmpeg -c copy. Packets move from input to output without touching a decoder or encoder, so a full-length movie remuxes in seconds and bit-exact quality is preserved. Use it to change containers (mp4 โ mkv), strip streams, cut on keyframes, or re-wrap after a download.
Lossless container rewrite: ffmpeg -c copy. Packets move from input to output without touching a decoder or encoder, so a full-length movie remuxes in seconds and bit-exact quality is preserved. Use it to change containers (mp4 โ mkv), strip streams, cut on keyframes, or re-wrap after a download.
Lossless container rewrite: ffmpeg -c copy. Packets move from input to output without touching a decoder or encoder, so a full-length movie remuxes in seconds and bit-exact quality is preserved. Use it to change containers (mp4 โ mkv), strip streams, cut on keyframes, or re-wrap after a download.
Converts audio frames between sample rates, channel counts and sample formats with FFmpeg's libswresample.
Converts audio frames between sample rates, channel counts and sample formats with FFmpeg's libswresample.
Converts audio frames between sample rates, channel counts and sample formats with FFmpeg's libswresample.
Converts audio frames between sample rates, channel counts and sample formats with FFmpeg's libswresample.
Audio sample format. Planar variants store each channel in its own plane; packed variants interleave channels. s16 / s16p is the most common decoder output.
Which way a seek may land relative to the target.
Which way a seek may land relative to the target.
Which way a seek may land relative to the target.
Which way a seek may land relative to the target.
Which way a seek may land relative to the target.
How a stream's pictures map onto a sphere around the viewer, as its container states it: in MP4 or MOV through Google's spherical video boxes or Apple's video extension box, in Matroska through the track's Projection element. FFmpeg reads it into the stream's AVSphericalMapping and applies none of it, so a renderer that draws the picture flat shows a 360 degree video as a stretched panorama.
How a picture covers the sphere, FFmpeg's AVSphericalProjection.
How a stream's pictures hold the views of two eyes, as its container states it: in MP4 or MOV through the stereoscopic video box or Apple's video extension box, in Matroska through the track's StereoMode. FFmpeg reads it into the stream's AVStereo3D and splits nothing, so a renderer that draws the picture whole shows both views side by side or one above the other.
How two views are packed into each picture, FFmpeg's AVStereo3DType.
Which views a stream's pictures hold, FFmpeg's AVStereo3DView.
One decoder driven explicitly by the caller.
One decoder driven explicitly by the caller.
One decoder, driven by the caller.
One decoder driven explicitly by the caller.
One decoder driven explicitly by the caller.
A field where the container's declaration and the decoder's output disagree.
Read-only snapshot of an input stream's metadata.
Decodes the packets of one subtitle stream, from MediaSource.openSubtitleDecoder. Read the packets with a PacketReader and hand each one to decode.
Decodes the packets of one subtitle stream, from MediaSource.openSubtitleDecoder. Read the packets with a PacketReader and hand each one to decode.
Decodes the packets of one subtitle stream, from MediaSource.openSubtitleDecoder. Read the packets with a PacketReader and hand each one to decode.
Decodes the packets of one subtitle stream, from MediaSource.openSubtitleDecoder. Read the packets with a PacketReader and hand each one to decode.
Decodes the packets of one subtitle stream, from MediaSource.openSubtitleDecoder. Read the packets with a PacketReader and hand each one to decode.
The policy that picks which video and audio stream to play when the caller did not name one.
Progress snapshot delivered during Transcoder.transcode.
High-level pipeline: open input โ decode โ optionally filter โ encode โ mux. The equivalent of ffmpeg -ss 12 -to 45 -i in.mp4 -vf "scale=โฆ" -c:v libx264 -c:a aac out.mp4 as one Kotlin call with proper cancellation and typed errors.
High-level pipeline: open input โ decode โ optionally filter โ encode โ mux. The equivalent of ffmpeg -ss 12 -to 45 -i in.mp4 -vf "scale=โฆ" -c:v libx264 -c:a aac out.mp4 as one Kotlin call with proper cancellation and typed errors.
High-level pipeline: open input โ decode โ optionally filter โ encode โ mux. The equivalent of ffmpeg -ss 12 -to 45 -i in.mp4 -vf "scale=โฆ" -c:v libx264 -c:a aac out.mp4 as one Kotlin call with proper cancellation and typed errors.
High-level pipeline: open input โ decode โ optionally filter โ encode โ mux. The equivalent of ffmpeg -ss 12 -to 45 -i in.mp4 -vf "scale=โฆ" -c:v libx264 -c:a aac out.mp4 as one Kotlin call with proper cancellation and typed errors.
Per-library version triplets, both columns.
How many rows and columns at each edge of a stream's decoded pictures are not part of the image, as the container says: a Matroska track's PixelCrop elements, or an MP4 track's clean aperture. Encoders use it to show 1080 lines of a 1088-line coded picture, cameras to hide sensor margins, and remuxers to cut black bars without encoding again.
One configured and opened video encoder. Pull from a Flow<Frame> via drive. That call pushes each frame into the encoder, pulls packets, hands them to the sink's muxer, and flushes when the flow completes.
One configured and opened video encoder. Pull from a Flow<Frame> via drive. That call pushes each frame into the encoder, pulls packets, hands them to the sink's muxer, and flushes when the flow completes.
One configured and opened video encoder. Pull from a Flow<Frame> via drive. That call pushes each frame into the encoder, pulls packets, hands them to the sink's muxer, and flushes when the flow completes.
One configured and opened video encoder. Pull from a Flow<Frame> via drive. That call pushes each frame into the encoder, pulls packets, hands them to the sink's muxer, and flushes when the flow completes.
What a video encoder writes: the format, the picture size and pixel format, the rate, and the colour, pixel shape and HDR metadata the output declares. MediaSink.addVideoEncoder opens an encoder from it, and Transcoder.transcode takes one as its video spec.
Per-input description for FilterGraph.buildVideoMulti.
What the container declares about a video stream.
Bits per sample in a VP9 stream.
VP9 chroma plane resolution. Chroma siting remains in ColorInfo.chromaLocation.
Codec-level VP9 declarations copied from FFmpeg's probed stream parameters.
A VP9 profile. number is its number in the VP9 bitstream specification.
Where an asynchronous runtime's codec modules are served. Give one address or both. The modules are in kiteffmpeg-wasm-js-<version>-web-async.zip of the wasmJs publication.
Converts video frames to RGBA without the pixels ever entering Kotlin memory.
Properties
FrameInfo.duration converted to microseconds. Null when the decoder supplied no duration. A duration is an interval, so no container start offset applies to it.
The hardware surface behind this frame, or null when its pixels are in main memory.
The assembled container-level view. Reads only members the source already exposes.
FrameInfo.pts converted to microseconds on the stream's own timeline. Null when the frame carries no timestamp.
Functions
Buffers a flow of AsyncFrame and closes every frame the collector does not receive. It is the suspending form of bufferFrames, which cannot serve here: the close of an AsyncFrame waits for the runtime's lane, and a channel's own hook for a dropped element cannot wait.
Buffers a frame flow without stranding the frames it is still holding.
The audio half of buildVideo's chain overload, with the same refusal.
Builds a video graph from a typed FilterChain, refusing before FFmpeg is asked to parse anything when this build lacks one of the chain's filters.
MediaSource.open over caller-supplied bytes, with typed DemuxOptions.
MediaSource.open with typed DemuxOptions instead of raw option pairs. interrupt behaves as it does on the raw overload; see OpenInterrupt.
The same over caller-supplied bytes. The source owns io and closes it, so io is spent when this returns, exactly as it would be after an MediaSource.Companion.open and a close.
Opens path, reads what it says about itself, and closes it again.