Skip to content

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

Open
k4idyn wants to merge 3 commits intoLizardByte:masterfrom
k4idyn:fix/amf-h264-profile-coder
Open

fix(amf): enable H.264 profile and coder selection#4927
k4idyn wants to merge 3 commits 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.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3 Security Hotspots

See analysis details on SonarQube Cloud

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.

1 participant