Vision and media
Images, video, interpretation, capture, and synchronized media.
Examples
oa
Types
10 members
Synchronized playback session over independent audio and video owners. Audio output frames consumed by the device callback are the master clock. Call tick from the engine-owning thread to advance video. Decode and audio callback workers never borrow or submit through Engine. The current frame retains its decoder backing and must obey VideoFrame::mark_consumed before its storage can be recycled.
Open both tracks paused, with the first video frame decoded. Native video output preserves its GPU backing. Opening requires a compatible Vulkan Video device and an audio output device.
Open both tracks paused, with the first video frame decoded. Native video output preserves its GPU backing. Opening requires a compatible Vulkan Video device and an audio output device.
Open both tracks paused, with the first video frame decoded. Native video output preserves its GPU backing. Opening requires a compatible Vulkan Video device and an audio output device.
Types
10 members
Synchronized playback session over independent audio and video owners. Audio output frames consumed by the device callback are the master clock. Call tick from the engine-owning thread to advance video. Decode and audio callback workers never borrow or submit through Engine. The current frame retains its decoder backing and must obey VideoFrame::mark_consumed before its storage can be recycled.
Open both tracks paused, with the first video frame decoded. Native video output preserves its GPU backing. Opening requires a compatible Vulkan Video device and an audio output device.
Open both tracks paused, with the first video frame decoded. Native video output preserves its GPU backing. Opening requires a compatible Vulkan Video device and an audio output device.
Open both tracks paused, with the first video frame decoded. Native video output preserves its GPU backing. Opening requires a compatible Vulkan Video device and an audio output device.
3 members
Two local tracks whose presentation timestamps share a zero-based epoch. Audio currently uses the incremental WAV/FLAC/MP3 source boundary of AudioPlayer. An audio track embedded in MP4 or Matroska is not yet extracted by OA; callers must provide a separately decodable audio file.
Source11 members
oa
Types
25 members
Dense pixels with explicit axis-order and channel-order semantics. Image composes a Matrix instead of erasing its numeric dtype and storage behavior. Construction validates all metadata once; the matrix is thereafter exposed immutably so the image contract cannot be invalidated.
8 members
Stateful hardware decoder for one demuxed video stream. The Experimental codec paths accept progressive H.264 Baseline/Main/High, H.265 Main, AV1 Main 8-bit 4:2:0 without film grain, or VP9 Profile 0 8-bit 4:2:0. AVC and HEVC access units contain one complete slice per picture; admitted AV1 and VP9 access units may contain hidden and show-existing pictures. Host-planar and retained native output are synchronous; Vulkan handles and queue ownership remain private.
Source7 members
Stateful packet source for one local video track. Metadata is bounded and validated at open. Indexed containers read only the current compressed sample; MPEG-TS assembles one bounded PES at a time. H.264/H.265 length-prefixed samples are normalized to Annex-B and codec parameter sets are prepended to the first keyframe after open or seek.
Source15 members
One timestamped video frame with retained storage and readiness semantics. The admitted packed-image path retains the backing Image, which in turn retains its crate::Matrix storage and exact producer readiness. Cloning a frame shares that retained value; it does not copy pixels or manufacture a second completion event.
Source10 members
Stateful streaming MP4 muxer for H.264/H.265 and optional PCM-S16 audio. Media payload is written as packets arrive. finalize appends the movie sample tables and closes the file. close deliberately abandons an unfinished file. Drop only releases the open file handle; it never manufactures a movie trailer or reports success.
Source24 members
Stateful local video player composed from VideoDemuxer and VideoDecoder. open decodes through the first display-order frame, so current_frame is immediately available on success. Timing controls do not create a second decoder or runtime owner; all hardware work remains inside the supplied Engine-owned decoder session.
Enums
Functions
Threshold against a local Gaussian-weighted mean minus c.
Threshold against the local arithmetic mean minus c.
Blend two equal semantic images using a * (1-alpha) + b * alpha.
Average an odd rectangular neighborhood up to 31×31.
Apply a bilateral neighborhood filter.
Apply value * contrast + brightness.
Return whether this build can decode codec.
Return whether this build can encode codec.
Extract a centered region with the requested exact extent.
Reorder one to four channels and explicitly assign the resulting format. order[c] selects the source channel for output channel c. The output format must have the same channel count as the input so pixel data and semantic metadata cannot diverge.
Clamp every pixel to the inclusive interval.
Apply one shared FP32 [3, 4] affine color transform to RGB channels.
Composite two equal images with a clamped Gray or per-channel mask.
Convert between three-channel RGB and BGR semantics, including identity.
Apply same-shape 2D cross-correlation with an odd FP32 kernel up to 31×31.
Extract a region, clipping its right and bottom edges to the source extent.
Decode a JPEG, PNG, WebP, BMP, or TGA file and upload normalized planar FP32 pixels. The result is one NCHW image shaped [1, channels, height, width]. This is a synchronous host codec boundary followed by device upload. Errors Returns an error for an empty path, filesystem failure, unsupported or malformed media, unsupported requested format, checked-size overflow, or device allocation/upload failure.
Decode JPEG, PNG, WebP, BMP, or TGA bytes and upload normalized planar FP32 pixels. The requested output format may be Gray, Rgb, or Rgba. The result is one NCHW image shaped [1, channels, height, width]. Errors Returns an error for empty, unsupported, or malformed media, unsupported requested format, checked-size overflow, or device allocation/upload failure.
Dilate with an odd rectangular structuring element up to 31×31.
Read normalized planar FP32 pixels and encode one still-image bitstream. quality is used by the lossy JPEG and WebP encoders and must be in [1, 100] for those codecs. This is an explicit blocking host-observation boundary. Errors Returns an error for Auto, unsupported image metadata, invalid quality, readback failure, checked-size overflow, or codec failure.
Fill the intersection of a rectangle and the image with one finite value.
Erode with an odd rectangular structuring element up to 31×31.
Flip an image horizontally, vertically, or along both axes.
Apply max(value, 0)^gamma * gain.
Apply a normalized Gaussian blur with replicate borders.
Add explicit-seed Philox Gaussian noise to every pixel.
Convert an RGB or RGBA image to Rec.709 grayscale.
Produce true_value for values inside the inclusive interval and zero outside it.
Invert every value around max_value.
Apply the four-neighbor discrete Laplacian.
Select the median of an odd square neighborhood up to 15×15.
Return the morphological closing minus the source.
Dilate and then erode with the same rectangular element.
Return dilation minus erosion.
Erode and then dilate with the same rectangular element.
Return the source minus its morphological opening.
Apply (pixel - mean[channel]) / std[channel] to up to three channels.
Add asymmetric padding with an explicit border policy.
Quantize [low, high] to levels evenly spaced values using round-half-up.
Resample an image from an FP32 absolute-coordinate map shaped [1|batch, 2, output_height, output_width].
Resize an FP32 channel-first image while preserving its layout and format. NCHW and CHW storage are supported. Nearest sampling follows the donor OA floor-coordinate rule. Bilinear sampling uses half-pixel centers with align_corners = false. The call records work asynchronously and returns an Image immediately. Reading its backing matrix is an explicit submission and observation point. Errors Returns an error for a zero target extent, an empty source extent, a dtype or layout outside the admitted checkpoint, checked-size overflow, or a runtime recording failure.
Bilinearly resize and normalize in one semantic and executable operation.
Rotate clockwise by a multiple of 90 degrees.
Replace a seeded fraction of pixels with salt or pepper values.
Encode an Image using the codec inferred from the output extension and save it. Supported extensions are .jpg, .jpeg, .png, .webp, .bmp, and .tga. This is an explicit blocking device-readback and filesystem boundary. Errors Returns an error for an empty or unsupported path, invalid image or quality, readback or encoding failure, or a host filesystem failure.
Encode and save one exact packed RGBA8 host image. This is the host sink used by render sessions after their own explicit completion and readback protocol has produced packed bytes. Errors Returns an error for an empty or unsupported path, zero or overflowing dimensions, a mismatched byte count, invalid quality, codec failure, or a host filesystem failure.
Compute one first-order Scharr derivative.
Blend a class palette over an RGB/RGBA image using an I32 label map.
Apply horizontal and vertical odd FP32 vector kernels up to length 31.
Apply a nonnegative four-neighbor sharpening amount.
Compute one first-order Sobel derivative.
Invert values at or above threshold around max_value.
Replace values above threshold with max_value and all others with zero.
Replace values at or below threshold with max_value and all others with zero.
Replace values at or below threshold with zero.
Replace values above threshold with zero.
Truncate values above threshold.
Apply an unsharp mask using a Gaussian detail estimate.
Apply an inverse FP32 2x3 affine transform to an image.
Apply an inverse FP32 3x3 perspective transform to an image.
Types
25 members
Dense pixels with explicit axis-order and channel-order semantics. Image composes a Matrix instead of erasing its numeric dtype and storage behavior. Construction validates all metadata once; the matrix is thereafter exposed immutably so the image contract cannot be invalidated.
Enums
Sampling behavior for coordinates outside an image.
Constant · Replicate · Reflect · Reflect101 · Wrap
Logical channel order carried by an Image. Scalar width and numeric representation remain properties of the backing Matrix; this format describes channel meaning only.
Gray · GrayAlpha · Rgb · Rgba · Bgr · Bgra
Functions
Emit borrowed NAL payloads as canonical four-byte-start-code Annex-B. Errors Returns an error when the output size overflows or host allocation fails.
Copy the first H.264 picture parameter set payload.
Copy the first H.265 picture parameter set payload.
Copy the first H.264 sequence parameter set payload.
Copy the first H.265 sequence parameter set payload.
Copy the first H.265 video parameter set payload.
Retain a render Texture as one timestamped video frame. The returned frame shares a buffer-backed Texture’s packed RGBA8 storage, semantic identity, and exact Matrix producer readiness. It performs no pixel copy, submission, wait, or Image conversion. Render targets require from_texture_with_ready so their producer completion is not lost. Errors Returns an error for a render-target-backed Texture.
Retain a texture and its exact producer completion in one video frame. This is the render-target path: it shares the texture and event without a readback, wait, or pixel copy. The event must belong to the texture’s Engine. Errors Returns an error when ready comes from a different Engine.
Inspect one raw access unit or the first frame of an IVF byte stream. Errors Returns an error for malformed IVF framing, invalid OBU structure, count overflow, or an empty frame payload.
Convert an MP4 length-prefixed H.264/H.265 sample into Annex-B NAL units. Errors Returns an error for a length width other than 1, 2, or 4, a truncated length field, a zero-sized NAL unit, arithmetic overflow, or payload overrun.
Parse one AV1 frame or frame-header OBU payload against explicit reference state. Errors Returns an error for truncated or inconsistent syntax and for donor features that are not yet represented: frame IDs, decoder-model removal timing, short reference signaling, non-uniform tiles, global motion, and film grain.
Split one raw AV1 access-unit payload into borrowed OBUs. Errors Returns an error for forbidden/reserved header bits, truncated extensions or LEB128 sizes, payload overruns, empty input, and arithmetic overflow.
Parse one AV1 sequence-header OBU payload. Pass Av1Obu::payload from an OBU whose type is Av1ObuType::SequenceHeader. The returned representation is independent of Vulkan’s standard-video C structures and retains the stream metadata needed to create exact backend profiles and session parameters. Errors Returns an error when the payload is empty or truncated, declares a reserved profile, carries an invalid frame-ID length, or encodes a chroma layout outside the AV1 profile rules.
Parse the tile ranges carried by one frame or tile-group OBU. Returned offsets are relative to the access-unit byte slice originally passed to super::parse_av1_obus, matching Vulkan Video’s source-buffer offset convention. Errors Returns an error for an incompatible OBU type, missing payload, invalid tile count/range/size width, truncated size fields, payload overruns, or offsets that do not fit Vulkan’s 32-bit tile arrays.
Parse one raw H.264 PPS NAL unit without an Annex-B start code.
Parse one raw H.264 coded-slice NAL using its resolved SPS and PPS. The returned picture-order-count field contains the coded LSB for POC type zero. POC types one and two require prior-picture state and therefore return None; the decoder session must derive the final POC rather than inventing a stateless approximation.
Parse one raw H.264 SPS NAL unit without an Annex-B start code.
Parse one raw H.265 PPS NAL unit without an Annex-B start code.
Parse one raw H.265 coded-slice NAL using its resolved SPS and PPS. Dependent slice segments and inline inter-predicted short-term reference sets require additional retained state and fail with MissingCapability.
Parse one raw H.265 SPS NAL unit without an Annex-B start code.
Parse one raw H.265 VPS NAL unit without an Annex-B start code.
Split an Annex-B byte stream into borrowed H.264 NAL payloads. Both 00 00 01 and 00 00 00 01 start codes are recognized. Bytes before the first start code and empty units are ignored, matching the donor oa::FnVideo::parseNalAnnexB contract.
Query the selected device’s exact limits for one decoder profile. Extension advertisement alone does not prove that a particular profile, chroma layout, bit depth, or codec option is usable. This query presents the complete profile to Vulkan and returns MissingCapability when rejected. Errors Returns an error when the codec extension is unavailable, the exact profile is unsupported, or the Vulkan capability query fails.
Enumerate decoded-output and DPB image formats for one exact profile. Errors Returns an error when the profile or its codec extension is unsupported, a Vulkan enumeration fails, or the driver reports an unreasonable result size.
Query Vulkan Video queues and codec extensions on the Engine’s selected device. This query reports both physical-device advertisement and whether Engine creation enabled video queues, and whether at least one qualified codec session path exists. Errors Returns an error when Vulkan device-extension or queue-family enumeration fails.
Query exact H.264 or H.265 encoder limits without creating a session.
Enumerate encode-input and DPB formats for one exact profile.
Types
5 members
Structural counts for one raw or IVF-wrapped AV1 access unit.
Source3 members
4 members
7 members
One borrowed AV1 OBU and its exact access-unit byte range.
Source3 members
One AV1 operating point declared by a sequence header.
Source7 members
Logical AV1 reference-map order hints supplied to a stateless frame parse.
Source5 members
10 members
One owned Annex-B video access unit with microsecond presentation timing.
Source3 members
H.264 VUI aspect-ratio syntax retained with an optional extended SAR.
Source3 members
H.264 hypothetical-reference-decoder parameters.
Source4 members
One decoded-reference-picture marking command from an H.264 slice header.
Source3 members
Parsed H.264 picture parameter set required by decode-session setup.
Source3 members
H.264 sequence- or picture-level scaling-list syntax in scan order.
Source5 members
3 members
3 members
4 members
One coded-picture-buffer entry in an H.265 HRD sub-layer.
Source4 members
H.265 decoded-picture-buffer limits for every temporal sub-layer.
Source4 members
H.265 hypothetical-reference-decoder parameters.
Source3 members
4 members
General H.265 profile-tier-level fields carried by a VPS.
Source4 members
Fully resolved H.265 scaling matrices in raster order. Prediction-mode references and diagonal coefficient walks are resolved by the parser, so backend lowering can copy these arrays without retaining bitstream-local prediction state.
Source3 members
4 members
One fully parsed H.265 short-term reference-picture set. Syntax masks are retained for standard-video lowering while delta_pocs contains the resolved candidate order required to parse a following inter-predicted set.
Source3 members
4 members
H.265 HRD syntax for one temporal sub-layer.
Source3 members
4 members
One VPS HRD table and the layer set to which it applies.
Source4 members
9 members
Borrowed H.264 NAL payload and decoded header fields. The payload starts at the NAL header byte and aliases the input Annex-B buffer. It does not include the three- or four-byte start code.
Source7 members
Source color metadata retained across frame transformations.
Source14 members
Immutable metadata for the selected video track.
Source17 members
8 members
Decode-output and decoded-picture-buffer formats for one exact profile.
Source8 members
Stateful hardware decoder for one demuxed video stream. The Experimental codec paths accept progressive H.264 Baseline/Main/High, H.265 Main, AV1 Main 8-bit 4:2:0 without film grain, or VP9 Profile 0 8-bit 4:2:0. AVC and HEVC access units contain one complete slice per picture; admitted AV1 and VP9 access units may contain hidden and show-existing pictures. Host-planar and retained native output are synchronous; Vulkan handles and queue ownership remain private.
Source7 members
Stateful packet source for one local video track. Metadata is bounded and validated at open. Indexed containers read only the current compressed sample; MPEG-TS assembles one bounded PES at a time. H.264/H.265 length-prefixed samples are normalized to Annex-B and codec parameter sets are prepended to the first keyframe after open or seek.
Source17 members
Hardware video queue and codec-extension capabilities for the Engine’s device. Hardware advertisement is distinct from OA session availability. The Engine creation enables advertised video queue/codec extensions, while Session availability is narrower than hardware advertisement: it becomes true only when OA has enabled and qualified at least one corresponding path.
24 members
8 members
Encode-input and reconstructed-picture formats for one exact profile.
Source6 members
5 members
Checked settings for the donor’s H.264 High or H.265 Main encode path. Construct this value independently of hardware, then call validate_for_device with the exact profile’s capability query. A successful preflight is not proof of session support.
Source15 members
One timestamped video frame with retained storage and readiness semantics. The admitted packed-image path retains the backing Image, which in turn retains its crate::Matrix storage and exact producer readiness. Cloning a frame shares that retained value; it does not copy pixels or manufacture a second completion event.
Source7 members
Presentation timing for one decoded, captured, or generated frame. The presentation timestamp is a non-negative offset from a stream-defined epoch. Duration is absent when the producer cannot determine it.
Source9 members
One Vulkan-video-compatible image representation without Vulkan types.
Source10 members
Stateful streaming MP4 muxer for H.264/H.265 and optional PCM-S16 audio. Media payload is written as packets arrive. finalize appends the movie sample tables and closes the file. close deliberately abandons an unfinished file. Drop only releases the open file handle; it never manufactures a movie trailer or reports success.
Source4 members
Configuration for one streaming MP4 muxer.
Source10 members
One owned compressed video access unit in the selected track time base.
Source24 members
Stateful local video player composed from VideoDemuxer and VideoDecoder. open decodes through the first display-order frame, so current_frame is immediately available on success. Timing controls do not create a second decoder or runtime owner; all hardware work remains inside the supplied Engine-owned decoder session.
4 members
Playback policy for one local video source.
Source4 members
Observable counters for one player lifetime.
Source6 members
Rational stream time base measured in seconds per timestamp tick.
SourceEnums
AV1 interpolation-filter selection.
EightTap · EightTapSmooth · EightTapSharp · Bilinear · Switchable
AV1 open-bitstream-unit identity.
SequenceHeader · TemporalDelimiter · FrameHeader · TileGroup · Metadata · Frame · RedundantFrameHeader · TileList · Padding · Reserved(u8)
H.264 decoded-picture layout.
Progressive · InterlacedInterleavedLines · InterlacedSeparatePlanes
H.264 profile identity used for exact decoder capability queries.
Baseline · Main · High · High444Predictive
H.265 profile identity used for exact decoder capability queries.
Main · Main10 · MainStillPicture · FormatRangeExtensions · ScreenContentCodingExtensions
Matrix coefficients associated with a frame’s source color conversion. This is deliberately narrower than complete color management. Primaries, transfer function, chromatic adaptation, and mastering metadata are not inferred from this value.
Unspecified · Bt601 · Bt709 · Bt2020
Encoded or converted component range associated with a video frame.
Unspecified · Limited · Full
Codec-specific maximum level reported for a decode profile.
H264(u32) · H265(u32) · Av1(u32) · Vp9(u32)
Multi-plane YUV image layout admitted by the Video runtime.
Yuv420Planar8 · Nv12 · Yuv420Planar10 · P010 · P012
Rate-control policy requested for a future Vulkan Video encoder session.
ConstantQp · Cbr · Vbr
VP9 profile identity used for exact decoder capability queries.
Profile0 · Profile1 · Profile2 · Profile3
Functions
Count [true_positive, false_positive, false_negative, true_negative] for two equally-shaped U8 masks. Every nonzero byte is true. Errors Returns an error unless inputs are nonempty, equal-shaped U8 matrices on one engine and their element count fits the shader ABI.
Compute every pairwise intersection-over-union for center-coordinate boxes. boxes_a and boxes_b must be nonempty FP32 matrices shaped [N, 4] and [M, 4]. Each row is [center_x, center_y, width, height]; negative widths and heights are clamped to zero, matching donor OA. A pair with no positive finite union produces zero. The returned matrix has shape [N, M]. The call records asynchronously and returns its output immediately. Reading the result is an explicit submission and observation point. Errors Returns an error when an input has the wrong rank, extent, dtype, or engine, a shader-ABI size overflows, allocation fails, or runtime recording fails.
Accumulate an integer classification confusion matrix. Rows are targets and columns are predictions. Either label being outside [0, class_count) ignores that element. Errors Returns an error unless inputs are equal nonempty I32 vectors on one engine, class_count is positive, and all sizes fit the shader ABI.
Evaluate object-detection precision, recall, F1, AP, and mAP. Matching is class-aware, image-aware, greedy by descending score, and uses 101-point interpolated average precision. Classes without targets do not contribute to mAP. Scratch and outputs remain GPU-resident. Errors Returns an error when any shape, dtype, ownership, class-count, score-threshold, or 32-bit scratch-size contract is invalid.
Evaluate multiclass semantic-segmentation labels. Labels outside [0, class_count) are ignored. The operation records a confusion accumulator followed by a metrics kernel as one semantic Vision operation. Errors Returns an error unless inputs are equal-shaped nonempty I32 matrices on one engine, class_count is positive, and all sizes fit the shader ABI.
Select score-ranked boxes with deterministic class-aware suppression. Equal scores select the smaller source index. NaN or infinite scores are ignored. All outputs remain device-resident and the operation never sorts or compacts on the host. Errors Returns an error unless boxes are nonempty FP32 [N, 4], scores are FP32 [N], classes are I32 [N], all inputs share an engine, thresholds are finite, iou_threshold is in [0, 1], and max_detections is positive.