Skip to content

fix: keep OutputTrack quality even when input stream is updated#2078

Merged
Keukhan merged 6 commits intomasterfrom
fix/keep-output-quality
Apr 21, 2026
Merged

fix: keep OutputTrack quality even when input stream is updated#2078
Keukhan merged 6 commits intomasterfrom
fix/keep-output-quality

Conversation

@Keukhan
Copy link
Copy Markdown
Member

@Keukhan Keukhan commented Apr 20, 2026

Summary

Improved OutputTrack quality retention behavior when the source stream is updated, along with minor refactoring.

Key Changes

1. Default Parameter Handling

  • OutputTrack now uses parameters defined in the Config as default values during create output track. so, removed previous logic that selected default values based on whether Config parsing was performed.

2. Output Track Initialization

  • If no user-defined settings are provided, parameters are automatically derived from decoded frame information:
    • Resolution, Timebase, Framerate, Bitrate, Samplerate, Channel

3. Behavior on Input Stream Update

  • Encoding mode

    • OutputTrack keeps its initial quality even if the input stream quality change.
  • Bypass mode

    • OutputTrack updates to match the changed input stream quality

@Keukhan Keukhan requested a review from a team as a code owner April 20, 2026 14:31
@Keukhan Keukhan requested review from Copilot and getroot and removed request for a team April 20, 2026 14:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates transcoder output-track initialization and update logic to better preserve output quality settings across input stream updates, while ensuring bypass tracks follow input changes.

Changes:

  • Refactors CreateOutputTrack(...) to apply config defaults directly (and centralizes skip-frames handling).
  • Splits decoded-frame-based output track updates into video/audio-specific paths and adds helper utilities (resolution alignment, skip-frames framerate adjustment).
  • Updates bypass-mode output-track updates to refresh additional parameters from the (potentially updated) input track.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/projects/transcoder/transcoder_stream_internal.h Updates internal APIs and adds private helpers for decoded-frame updates and alignment/skip-frames handling.
src/projects/transcoder/transcoder_stream_internal.cpp Implements refactored output-track creation/update logic, adds helpers, and extends profile serialization.
src/projects/transcoder/transcoder_stream.cpp Adjusts bypass update call to pass the input track into the passthrough updater.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/projects/transcoder/transcoder_stream_internal.cpp Outdated
Comment thread src/projects/transcoder/transcoder_stream_internal.cpp
Comment thread src/projects/transcoder/transcoder_stream_internal.cpp
Comment thread src/projects/transcoder/transcoder_stream_internal.cpp Outdated
Comment thread src/projects/transcoder/transcoder_stream_internal.cpp
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts how TranscoderStream/TranscoderStreamInternal initialize and update OutputTrack parameters so that, in encoding mode, the output keeps its initially-determined quality even if the input stream’s quality changes, while bypass mode continues to follow input changes.

Changes:

  • Refactors output-track updates by splitting decoded-frame updates into video/audio helpers and expanding passthrough updates to also take the input_track.
  • Simplifies output-track creation to apply config-provided defaults directly (and adds validation for unsupported codec types).
  • Extends video profile serialization to include ExtraOptions (via hash) so encoder/profile identity changes when extra options change.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/projects/transcoder/transcoder_stream_internal.h Updates method signatures and adds helper/utility declarations used by the new update logic.
src/projects/transcoder/transcoder_stream_internal.cpp Implements the new retention/update behavior, codec validation, skip-frame/framerate alignment helpers, and serialization change.
src/projects/transcoder/transcoder_stream.cpp Updates call site to pass input_track into passthrough output-track updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/projects/transcoder/transcoder_stream_internal.cpp Outdated
Comment thread src/projects/transcoder/transcoder_stream_internal.cpp
Comment thread src/projects/transcoder/transcoder_stream_internal.cpp Outdated
Comment thread src/projects/transcoder/transcoder_stream_internal.cpp
Comment thread src/projects/transcoder/transcoder_stream_internal.cpp Outdated
@Keukhan Keukhan requested review from dimiden and removed request for getroot April 21, 2026 05:24
Comment thread src/projects/transcoder/transcoder_stream.cpp Outdated
Comment thread src/projects/transcoder/transcoder_stream_internal.cpp Outdated
@Keukhan Keukhan requested a review from dimiden April 21, 2026 10:19
@Keukhan
Copy link
Copy Markdown
Member Author

Keukhan commented Apr 21, 2026

@dimiden Please review again. :)

@dimiden
Copy link
Copy Markdown
Member

dimiden commented Apr 21, 2026

LGTM

@Keukhan Keukhan merged commit be6b79e into master Apr 21, 2026
2 checks passed
@Keukhan Keukhan deleted the fix/keep-output-quality branch April 21, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants