Skip to content

fix(amf): enable H.264 profile and coder selection#4927

Open
k4idyn wants to merge 1 commit intoLizardByte:masterfrom
k4idyn:fix/amf-h264-profile-coder
Open

fix(amf): enable H.264 profile and coder selection#4927
k4idyn wants to merge 1 commit intoLizardByte:masterfrom
k4idyn:fix/amf-h264-profile-coder

Conversation

@k4idyn
Copy link
Copy Markdown

@k4idyn k4idyn commented Mar 30, 2026

Description

  • Currently, the AMD AMF encoder (h264_amf) in src/video.cpp does not have the profile and coder options wired up in its encoder_t definition. This prevents clients that strictly require H.264 Baseline/CAVLC (like the Sony PSP or other legacy hardware decoders) from successfully streaming, as the encoder defaults to High Profile and CABAC regardless of the client's request or the global configuration.
  • Why this is needed
    Older hardware decoders often have hardwired limitations. For example, the PSP-1000's Media Engine only supports:
  • H.264 Baseline Profile (not Main or High)
  • CAVLC entropy coding (not CABAC)

While Sunshine/Apollo allows selecting cavlc in the UI, this setting is ignored by the h264_amf encoder because it isn't passed to the FFmpeg avcodec_open2 dictionary.

  • Proposed Fix
    Update the amdvce definition in src/video.cpp to include the missing options:
        {"coder"s, &config::video.amd.amd_coder},
        {"profile"s, [](const config_t &cfg) {
           if (cfg.profile == 66) return "baseline"s;
           if (cfg.profile == 77) return "main"s;
           return "high"s;
         }},

This brings the AMD implementation into parity with NVENC and QuickSync.

Screenshot

image

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • [X ] fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • [X ] Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • [ X] Heavy: AI generated most or all of the code changes

@ReenigneArcher
Copy link
Copy Markdown
Member

Thank you for the PR submission, but I noticed you didn't use our PR template.

Please update the PR to use the correct template. You can find it at https://github.com/LizardByte/.github/blob/master/.github/pull_request_template.md?plain=1

@ReenigneArcher ReenigneArcher added the ai PR has signs of heavy ai usage (either indicated by user or assumed) label Mar 30, 2026
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You don't like our ci-windows.yml workflow?

@k4idyn k4idyn force-pushed the fix/amf-h264-profile-coder branch from 46ed0ac to 3b8a19f Compare March 30, 2026 19:04
@k4idyn k4idyn requested a review from ReenigneArcher March 30, 2026 19:34
@k4idyn k4idyn force-pushed the fix/amf-h264-profile-coder branch from 4fe233d to 3b8a19f Compare March 30, 2026 19:40
@k4idyn k4idyn closed this Mar 30, 2026
@k4idyn k4idyn reopened this Mar 30, 2026
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai PR has signs of heavy ai usage (either indicated by user or assumed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants