Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

#28 (3): EncodeOpts' doc says what openh264 does with a quality: it has no constant-quality mode and scales kbps by it (raea_io_soft::quality_kbps, 298d32431); it said kbps was ignored where a quality is set (part of #28)

shinyobjectzf0094cbc3bfd
diff --git a/io/codec/src/lib.rs b/io/codec/src/lib.rs
index 84a9fe83..97069768 100644
--- a/io/codec/src/lib.rs
+++ b/io/codec/src/lib.rs
@@ -152,10 +152,11 @@ pub struct EncodeOpts {
pub height: u32,
pub fps: f64,
/// target video bitrate in kbps (an average; VideoToolbox spends less on easy pictures). Ignored where `quality` is
- /// set and the backend takes it.
+ /// set and the backend has a constant quality; openh264 scales it by the quality.
pub kbps: u32,
/// constant quality, 0..1 (VideoToolbox's kVTCompressionPropertyKey_Quality; libx264's CRF through the ffmpeg
/// backend), in place of `kbps`: each frame gets the bits its picture needs. None: the average bitrate.
+ /// openh264 (Windows, Linux) has no such mode: it scales `kbps` by the quality instead (raea_io_soft::quality_kbps).
#[serde(skip_serializing_if = "Option::is_none")]
pub quality: Option<f32>,
/// frames will arrive as NV12 (push_nv12): platform encoders set up for it, so nothing converts on the CPU