Skip to content

Interlaced 1080i (MBAFF) H.264 fails to decode — VAAPI host transcode has no deinterlace or software-decode fallback #402

Open

Description

@fluxis

Summary


Every other 1080p title I've checked in the library reports field_order=progressive. These two are encoded as interlaced, which appears to be the characteristic the decoder is choking on—not the H.264 profile itself.

┌──────────────────┬──────────────────────────────┬────────────────────────┬──────────────────────────┐
│                  │     The White Queen S01      │ LEGO Masters (AU) S08  │ A Normal Title           │
├──────────────────┼──────────────────────────────┼────────────────────────┼──────────────────────────┤
│ content_id       │ series-tvdb-266092           │ series-tvdb-362540     │ —                        │
│ Source           │ Blu-ray Remux                │ HDTV                   │ Blu-ray Remux            │
│ Codec            │ H.264 [email protected]             │ H.264 [email protected]       │ H.264 High              │
│ field_order      │ tt (Top-Field-First)         │ tt (Top-Field-First)   │ progressive              │
│ interlaced_frame │ 1                            │ 1                      │ 0                        │
│ top_field_first  │ 1                            │ 1                      │ 0                        │
│ Frame Rate       │ 59.94 fields (~29.97 fps)    │ 25 fps                 │ 23.976 fps               │
│ Pixel Format     │ yuv420p 8-bit                │ yuv420p 8-bit          │ yuv420p 8-bit            │
│ Audio            │ TrueHD 5.1 + AC3 compat      │ AC3 5.1 384k           │ FLAC 2.0                 │
└──────────────────┴──────────────────────────────┴────────────────────────┴──────────────────────────┘


Both files report interlaced_frame=1 on full frames (not separate field pictures), indicating MBAFF (Macroblock-Adaptive Frame/Field Coding), Top-Field-First (TFF) encoding.```

## Reply digest

Two 1080i interlaced H.264 (MBAFF) titles fail to play while every progressive title works. Reported under tvOS, but the root cause is host-side: the VAAPI/renderD128 transcode path forces full hardware decode with no interlaced/MBAFF handling and no software fallback. The probed field_order/isInterlaced flag exists but is display-only and never reaches the decode decision, and there is no deinterlace filter anywhere.

## Code references

Verified OPEN as of 2026-07-14 against origin/main; no interlace/MBAFF handling in the transcode path. Repo corrected to server (not apple) — decode is entirely host-side.
- internal/playback/transcode.go:484-495 — VAAPI branch forces full hw decode (-hwaccel vaapi -hwaccel_output_format vaapi) with no interlaced/MBAFF check and no software fallback.
- internal/playback/transcode.go:30-59 — TranscodeOpts has no Interlaced field, so the probed interlace flag can't reach a decode decision.
- internal/scanner/probe.go:190,384 — isInterlaced(field_order) is computed and stored but has zero consumers in the transcode path.
- No deinterlace_vaapi/yadif/bwdif filter exists anywhere in internal/ — no deinterlace stage at all.

## Attachments

_None._

## Source

Imported from Discord:
- https://discord.com/channels/1487838737248292864/1526226312723697804

<!-- discord-thread:1526226312723697804 -->

Activity

  1. added theissue type on Jul 14, 2026
  2. added
    bug
    triaged
    and removed
    triaged
    bug
    on Sep 20, 2026
  3. self-assigned this
    on Nov 13, 2026
  4. Quick104 commented on Nov 13, 2026

    @Quick104
    Contributor

    🤖 AI agent claim. Claude Code (claude-fable-5-2) is working on a fix for this issue on behalf of @Quick104, who is assigned.

    A pull request will link here when the fix is ready. If the work stops without a fix, the assignment and this comment are removed.

    Planning to work on this, or have context to add? Reply here and mention @Quick104.

  5. Quick104 commented on Nov 26, 2026

    @Quick104
    Contributor

    The NVENC path has the same gap. During v1.0 validation of NVENC transcoding (#1172) on build 2970 (a16a24720), an interlaced MPEG-2 480i fixture transcoded on an NVIDIA node came out interlaced: the hardware filter chain is scale_cuda only, and idet flagged most output frames as interlaced. The software path on the same file adds bwdif, and its output is progressive.

    The cause is in internal/playback/transcode.go: appendVideoFilterArgs deinterlaces only CPU-decoded video (opts.SoftwareVideoDecode || !isHardwareTranscodeBackend(opts.HWAccel)), and the NVENC branch of the scale filter adds no deinterlace step (QSV and VAAPI have the same shape). So a fix for this issue should cover NVENC (for example yadif_cuda or bwdif_cuda) as well as VAAPI.

    Posted with Claude Code (claude-opus-5-5) and GitHub CLI at the maintainer's direction.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions