Skip to content

rust: Port the encoder size and info choices in obs-encoder.c to obs-output #2134

Closed

Description

@rdoupe

Unit

Port the encoder size and info choices in libobs/obs-encoder.c.h to rust/obs-output, as a new module encoder_size next to encoder_roi. These decisions move:

  • get_audio_info: an unknown format, sample rate or channel layout defaults to the mix's.
  • get_video_info: the scaled size, and the OBS_ENCODER_CAP_SCALING override that comes after the plugin's get_video_info.
  • obs_encoder_set_scaled_size:
    • the refusals: not a video encoder, active, or initialized;
    • the rule that turns scaling off when the size matches the output.
  • obs_encoder_scaling_enabled, obs_encoder_get_width, obs_encoder_get_height and obs_encoder_get_sample_rate.

These stay in C:

  • the plugin callbacks, between the steps in their current order;
  • the warnings that name the encoder;
  • video_output_get_info and audio_output_get_info.

Plan (one PR, separate commits)

  1. A behaviour-neutral move into libobs/obs-encoder-size.c.h, as hidden functions.
  2. Characterization in test_encoder_size_steps. It covers:
    • every refusal;
    • the match rule with equal and unequal sizes, and with no video info;
    • the cap override with and without the cap;
    • the audio defaults with each field unknown;
    • the width and height with and without a scaled size or media.
  3. RED, then GREEN: the safe Rust core plus shims, in a libobs.ported-encoder-size group. Exported symbols are unchanged.
  4. Tier 3 parity against the original C: exhaustive over caps and flags, plus a proptest over full-range u32 sizes. Also a deliberate-break check and port_comparison numbers.

These real-libobs tests must stay green on every lane:

  • test_encoder_video_reset
  • test_encoding_lag_rescale
  • test_multitrack_encoder_override
  • test_encoder_fallback
  • test_encoder_roi

Activity

  1. rdoupe commented on Oct 24, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #2134.

  2. added
    claimed
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions