Skip to main content

Crate alpha2_native

Crate alpha2_native 

Source
Expand description

Native FFmpeg 8 media adapter.

All rsmpeg and FFmpeg types remain private to this binding. Public callers only observe the platform-neutral alpha2-media contracts.

Mixing a timeline project’s audio needs the timeline feature, which is the only part of this crate that links the project model and the engine.

Structs§

AudioStreamConfig
The audio stream an export encodes beside its video.
AvEncodeConfig
Configuration for transactional audio/video export.
CodecThreadAllocation
One export-wide software-codec allocation. Every decoder receives decoder_threads; the software video encoder receives encoder_threads.
CodecThreadRequest
What one export needs from the shared software-codec worker budget.
ConcealedAudioGap
An interval decoded as silence, at the decoder’s output sample rate: where damaged input was dropped, or where the stream’s timestamps jump.
CorruptPacket
One observed corruption. Timestamps use the selected stream’s time base.
DecodeDiagnosticCounts
What decoders reported, counted: the summary a caller gives of the damage Tolerant decoding skipped and the silence it inserted. Samples are at the reporting decoder’s output rate.
DecodeDiagnostics
Cumulative diagnostics. Records are bounded; overflow fails decoding.
DecodeProgressWatch
Ends a watch_decode_progress watch, restoring the one before it.
DecodeStageTimings
Where one video decode session’s wall time went.
DecodedAudioSources
Decoded, project-rate planar audio held per source for offline mixing.
DroppedAudioOverlap
Samples whose timestamps put them over samples already decoded, dropped, at the decoder’s output sample rate.
EncodeCallWatch
Ends a watch_encode_calls watch, restoring the one before it.
EncodeStageTimings
Where one encode sink’s wall time went.
EncoderPoolStats
Surface-pool counters for one session.
EncoderSurface
One encoder-input surface on loan from its session’s pool.
EncoderSurfaceDescriptor
What one encoder-input surface is, independent of its backing.
FfmpegRuntimeIdentity
FFmpeg runtime and pinned SDK identity used by native diagnostics.
FrameScore
How a frame would do as a thumbnail.
HardwareEncodeCapability
What one hardware encoder accepts on this device, read from the device.
HardwareEncodeDevice
The renderer’s device, as a hardware encoder can use it.
HardwareEncodeInput
The coordinator’s half of a hardware session.
HardwareEncodeRequest
One export’s encoder settings and output.
HardwareEncodeSession
The encode worker’s half of a hardware session.
HardwareOpenError
A hardware decode session that could not be opened, with its typed reason.
HostAudioConfig
Platform-neutral device range used by negotiation tests and cpal mapping.
InputFrame
A frame the coordinator has begun: its planes are the renderer’s to write until HardwareEncodeInput::submit takes it.
NativeAudioDecoder
Streaming FFmpeg audio decoder normalized to project-rate planar f32.
NativeAudioEncoderCapability
One linked audio encoder available to the native sinks.
NativeAvEncodeSink
Audio/video sink that encodes and interleaves through the linked FFmpeg libraries without requiring command-line programs on the host. Video frames and audio blocks must be submitted in nondecreasing start-timestamp order; ready packets are muxed incrementally instead of retained for the full file.
NativeCodecCapabilities
Runtime codec inventory for the native sinks.
NativeDecoder
Software video decoder with exact timestamp conversion and drain semantics.
NativeEncoderHardwareConfig
One hardware configuration a video encoder declares.
NativeExportDecoder
Export decoder producing NativeVideoFrames from one FFmpeg session.
NativeHardwareDecodeCapabilities
Hardware decode registration reported by the linked FFmpeg build.
NativeHardwareDecodeCapability
One codec’s hardware decode registration for this platform’s backend.
NativeRateControlProbe
Whether one encoder opened with one rate-control mechanism.
NativeVideoEncodeSink
Transactional FFmpeg video encoder and muxer.
NativeVideoEncoderCapability
One linked video encoder available to the native sinks.
NativeVideoEncoderFallback
One candidate encoder an export tried and moved past.
NativeVideoEncoderProbe
What one registered video encoder declares, and what happened when alpha2 opened it on this machine.
NativeVideoEncoderSelection
The encoder an export actually opened, and what it passed over.
NativeVideoFrameMetadata
Platform-neutral metadata carried identically by CPU and hardware frames.
NativeWavEncodeSink
Transactional IEEE-f32 WAV encoder used by native offline audio export.
PacketCopy
One or more copy runs written back to back into one output.
PacketCopyAudio
What a copied audio stream must match.
PacketCopyPlan
A copy that can be made, and what it copies.
PacketCopyPlanner
Plans the runs of one export, reading each source file once however many runs it serves, and stopping when the export is cancelled.
PacketCopyReport
What a copy wrote.
PacketCopyRequest
The stream an export copies from and what it must match.
ProbeResult
Container-level probe and deterministic stream selection.
ProjectAudioRequest
One offline project-audio render request.
VideoDisplay
How encoded pictures are shown: what a container records beside them rather than in them.
VideoEncodeConfig
Configuration for deterministic native video encoding.
VideoRecoveryGap
Healthy video boundaries surrounding dropped data. Unknown endpoints remain absent.
VulkanDecodeProbe
Aggregate result from a bounded Vulkan hardware decode and surface probe.
VulkanEncodeProbe
What one Vulkan encode session turned out to require and produce.
Yuv420pFrameBuffer
A reusable FFmpeg YUV420P frame the caller writes into directly.

Enums§

AppliedRateControl
Which form of a resolved rate control an encoder actually ran.
CopyAudio
The audio a packet copy writes beside its video.
DecodeDiagnostic
A recovery observation emitted synchronously before decoding continues.
DecodePolicy
Damaged input handling. Initialization and resource errors are always fatal.
EncoderInputHandoff
How a packed frame reaches the encoder’s surface.
EncoderInputLayout
How the pixels of an encoder-input surface are laid out.
HardwareDecodeFallback
Why a video source is decoded in software instead of on the GPU.
HardwareEncodeBackend
The native API a hardware encode session drives.
HardwareEncodeOpenError
Why a hardware session did not open.
HostSampleFormat
Host sample representation considered during deterministic negotiation.
NativeAudioCodec
Audio codecs implemented by the native encode sinks.
NativeEncoderClass
How a concrete encoder executes, as the linked runtime declares it.
NativeEncoderRejection
Why one candidate encoder was not the one an export opened.
NativePlaneLayout
Plane organization of a native export frame.
NativeVideoCodec
Video codecs implemented by the native encode sinks.
NativeVideoFrame
One decoded export frame with either owned CPU pixels or an opaque surface.
OfflineAudioError
Native offline-render failure.
RateControlMechanism
A way of controlling an encoder’s rate, independent of how a family spells it.

Constants§

DECODE_WORK_LIMIT
The longest a decoder operation (a seek, the next frame, an open’s first frame) may go without producing a frame before it fails with “decode progress budget exceeded”: the time since it started or since its last decoded frame, between the FFmpeg calls it makes. A seek that decodes from a distant keyframe at a steady pace takes as long as it needs; a loop that decodes nothing does not.
PARTIAL_OUTPUT_IN_USE
The words an output refused because a live export writes its partial file (EncodeError::OutputInUse) starts with.
SOURCE_SAMPLE_RATES
The sample rates a source’s audio may have: none is recorded below 1 kHz or above 768 kHz, the most alpha2_audio::Resampler takes. A file that declares 1 Hz would otherwise turn each of its samples into a project’s 48,000.
THUMBNAIL_LUMA_RANGE
Mean luma, as a fraction of full scale, below which a frame is black and above which it is white: neither makes a thumbnail.

Traits§

AudioBlockFeed
The export’s mixed audio, block by block, for a copy that encodes it.
HardwareFrameLease
Opaque decoder surface retained until GPU completion.

Functions§

check_yuv_transcode
Decides whether source’s decoded pictures can become a widthxheight output’s frames as they are, with no conversion: the file side of a YUV transcode, whose project side is the same untouched tiling a copy needs.
choose_thumbnail
The best thumbnail among scored frames: the sharpest that is neither black nor white, or the sharpest of all when every frame is. None for no frames.
codec_capabilities
Reports the linked FFmpeg encoders usable by alpha2’s native sinks.
codec_thread_allocation
Divides the export CPU budget across concurrently active codec contexts.
codec_thread_budget
Returns the worker budget for one standalone software video codec context.
codec_thread_override
The worker budget setting names: None unset, a positive count up to 64 (clamped), or the setting itself as the error when it is anything else (0, a word), which leaves the default in force.
configured_codec_thread_override
The software-codec worker budget ALPHA2_FFMPEG_THREADS sets (codec_thread_override).
copy_packets
Writes copy’s runs, back to back, into a new container file at output, with audio. The runs were planned for container (PacketCopyRequest::container).
downscale_frame
The frame shrunk by factor (2 for half size, 4 for quarter), each output sample the mean of the factor x factor block it covers, the visible size rounded down to even numbers so 4:2:0 encoders take it.
ffmpeg_runtime_identity
Returns the loaded FFmpeg identity together with the release SDK pin.
hardware_decode_backend
Backend this build decodes with, independent of any device being present.
hardware_decode_capabilities
Reports which codecs the linked FFmpeg registers for this backend.
hybrid_encoders_use_hardware
Whether hybrid encoders are configured to run on the GPU.
negotiate_output_config
Selects an output that plays stereo, requiring exact project-rate f32 support.
plan_packet_copy
Decides whether request can be served by copying packets.
probe
Opens a local resource using the system FFmpeg 8 shared libraries.
probe_video_encoders
Opens every registered video encoder and reports what it actually does.
probe_vulkan_decode
Decodes Vulkan frames without mapping, downloading, or uploading their planes.
probe_vulkan_encode
Opens h264_vulkan against device and encodes one pool frame.
remove_stale_partial_output
Removes a sibling partial file left by an interrupted transactional export.
render_offline
Runs the same graph used by realtime hosts and writes exact project-rate blocks.
render_project_audio
Mixes a whole project audio range and writes exact project-rate blocks.
require_pinned_ffmpeg_for_tests
Panics unless the loaded FFmpeg is the pinned SDK, for tests to call before they use it.
resize_rgba
Straight-alpha RGBA pixels, width x height, resized to new_width x new_height: each axis resampled by a tent filter as wide as a source pixel or an output pixel, whichever is wider, so an axis that shrinks averages what each output pixel covers (as a proxy averages its blocks) and one that grows interpolates. Colour is weighted by alpha, so a transparent pixel’s colour does not bleed into its neighbours. An axis that keeps its size is left exactly as it is.
same_chroma_siting
Whether chroma sited at source is where output puts it, reading an unspecified location as centred, as import does.
score_frame
Scores a frame on a fixed grid of luma samples, so the score does not depend on the frame’s size.
software_decode_unsupported
Why this runtime cannot decode stream without a hardware session, or None when a software session can. A probe names the decoder FFmpeg prefers (StreamInfo::codec); some of those decode only through a hardware session, and a runtime without libdav1d has no software AV1 decoder.
visit_packet_times
Visits the presentation time, in seconds, of each packet of the stream with AVStream index stream, in the order the file stores them, until visit returns false or the file ends. A packet without a presentation time is visited at its decode time; one with neither is skipped. Only packets are read: nothing is decoded.
watch_decode_progress
Calls progressed on this thread each time a decoder operation running on it produces a frame, or a packet copy’s plan reads a source packet, until the guard drops.
watch_encode_calls
Calls beat on this thread before every encoder and muxer call an encode sink makes on it, until the returned guard drops.
write_replacing
Writes a whole file at final_path, replacing a regular file there only once write has written all of it: write fills the claimed partial file beside it (the same claim and lock a video output takes), which is synced and renamed into place. Any failure removes the partial and leaves what was at final_path. Only a regular file is replaced; anything else there is refused before anything is written (and again just before the rename, as it may have changed meanwhile; what changes between that look and the rename is not guarded against, as the caller chose the path).