Skip to content

feat(markers): detect credits for episodes #730

Closed

Description

@tomislav

Summary

Extend Silo's intro marker analyzer so it can also detect credits for episodes from embedded chapters and recurring audio near the end of a file.

Silo already stores, serves, edits, and prioritizes credits markers. Local analysis currently examines only the opening portion of an episode and writes only intro markers.

Problem

The current analyzer in internal/intromarkers:

  • recognizes embedded intro chapters;
  • fingerprints the first 25% or 10 minutes of an episode, whichever is shorter;
  • compares episodes within compatible season, edition, and audio-language groups;
  • writes only intro ranges.

Credits therefore require a marker provider, a manual edit, or a precomputed S3 marker object. Silo cannot detect them from local episodic media.

Proposed behavior

Generalize the existing analyzer enough to detect episode credits alongside intros rather than creating an independent credits scanner.

The analyzer should:

  1. Recognize named credits, ending, and outro chapters.
  2. Extract one bounded fingerprint window near the end of each episode.
  3. Compare compatible episodes to find recurring ending audio.
  4. Classify a high-confidence match near the end as credits using its position, duration, and chapter evidence.
  5. Optionally use silence and black-frame signals to refine candidate boundaries.
  6. Write the result through the existing credits marker update path with its own source, confidence, algorithm, and detection time.

Silence or black frames must not independently establish that a segment is credits. They are boundary signals for a candidate supported by chapter or fingerprint evidence.

Credits policy

Initial defaults should constrain credits to:

  • a bounded window near the end of an episode;
  • a duration between 15 seconds and 5 minutes;
  • a non-overlapping range that ends at or before the media duration.

Exact window sizes and confidence thresholds should remain configurable. The first version should favor leaving credits unset over producing a low-confidence marker.

Architecture constraints

  • Reuse the existing episode grouping, FFmpeg concurrency limit, fingerprint cache, season analysis state, and source-priority rules.
  • Extract the ending fingerprint once per file rather than separately for chapter, audio, silence, or black-frame analysis.
  • Cache opening and ending fingerprints independently so configuration changes invalidate only incompatible analysis data.
  • Keep analysis idempotent and safe to retry after cancellation, process failure, or node loss.
  • Never replace a credits marker from a higher-priority source.
  • Preserve independently sourced intro and credits markers on the same media file.
  • Continue grouping versions by presentation group, edition, and audio language.
  • Do not require S3. Local analysis writes credits through the database repository.
  • Rename intro-specific packages, tasks, settings, and API types only where the old name would become misleading. Avoid a compatibility layer for pre-lock internal or v1 names.

API and client impact

No new playback marker shape is required. Silo already exposes credits ranges through:

  • native item and playback responses;
  • marker administration endpoints;
  • download manifests;
  • Jellyfin-compatible /MediaSegments, where credits map to Outro.

Review any intro-specific administrative endpoint or library setting names that become inaccurate after credits detection is added. If a native v1 field or endpoint is renamed, coordinate the pre-lock change with web, Apple, and Android clients and record the removal in docs/architecture/v1-scope.md.

Acceptance criteria

  • An enabled episodic library can detect credits locally while retaining existing intro detection behavior.
  • Named credits, ending, or outro chapters can produce credits markers without Chromaprint analysis.
  • Chromaprint analyzes a bounded ending window, not the entire file by default.
  • Recurring ending matches can be classified as credits.
  • Silence or black-frame analysis refines only a candidate already supported by chapter or fingerprint evidence.
  • Credits results do not overlap an existing intro marker or exceed the file duration.
  • Each detected credits segment records its own source, confidence, algorithm, and detection time.
  • Manual and other higher-priority credits markers are not overwritten.
  • Re-analysis can replace an older scanner credits marker when the new algorithm or result wins under documented precedence rules.
  • Multiple compatible versions of an episode are handled without copying timestamps between materially different runtimes.
  • Cancellation or partial failure leaves completed marker writes and cached fingerprints valid for a later retry.
  • The run summary reports ending-window candidates, cache hits, credits writes, skips, refinements, and errors.
  • Focused tests cover chapter recognition, ending-window extraction, recurring-match classification, precedence, overlap handling, version handling, cache invalidation, and retry behavior.
  • Jellyfin /MediaSegments returns detected credits as Outro.
  • Native item detail and playback responses return the detected credits range.
  • Admin wording refers to local marker detection rather than intro-only detection where appropriate.
  • Relevant API and architecture documentation is updated.
  • docs/feature-changelog.md records the user-facing change.

Out of scope

  • Recap detection.
  • Preview detection.
  • Movie credit detection.
  • Commercial detection.
  • Whole-file fingerprinting by default.
  • Treating silence or black frames as sufficient classification evidence.
  • Changes to automatic skip or next-episode playback policy.
  • Importing or embedding Intro Skipper's implementation.
  • A backwards-compatibility shim for pre-lock API names.

Implementation notes

Intro Skipper demonstrates that chapter data, Chromaprint comparison, black-frame detection, and silence detection can support credits detection. This issue does not require matching its implementation or every configurable heuristic. The first version should favor high-confidence results and leave uncertain credits unset.

Reference: https://github.com/intro-skipper/intro-skipper/wiki#detection-types

Likely server areas include:

  • internal/intromarkers
  • internal/scanner
  • internal/markers
  • internal/taskmanager/tasks
  • library administration handlers and settings
  • Jellyfin media-segment tests

Any database change must use a new Goose migration created with make migrate-create. Existing migrations and encrypted setting keys must not be renamed in SQL.

AI Disclosure

  • Tool(s): OpenAI Codex
  • Model(s): GPT-5
  • Involvement: AI-assisted
  • Adversarial review: Narrowed the original multi-marker proposal to episodic credits only. Compared it against the current intro analyzer, per-segment marker repository, source-priority rules, Jellyfin /MediaSegments handler, migration rules, and Intro Skipper's published detection documentation. Kept chapter and recurring-audio evidence as the basis for classification and limited silence or black frames to boundary refinement. Human verification is required before implementation.

Activity

  1. changed the title [-]feat(markers): detect credits, recaps, and previews for episodes[/-] [+]feat(markers): detect credits for episodes[/+] on Aug 30, 2026
  2. added
    triaged
    and removed
    triaged
    on Sep 20, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions