Skip to content

feat(markers): use end-credit visuals for episode credits - #1542

Merged
Quick104 merged 27 commits into
mainfrom
outro/c3-credits-visuals
Sep 27, 2026
Merged

Quick104 merged 27 commits into
mainfrom
outro/c3-credits-visuals

Conversation

@Quick104

@Quick104 Quick104 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #730
Related issue: #1147
Validation tasks: changes #1148 C1; changes #1149 C1; changes Silo-Server/silo-apple#311 C1; changes Silo-Server/silo-apple#312 C1; changes Silo-Server/silo-android#321 C1; changes Silo-Server/silo-android#322 C1

Ending audio alone misses episodes whose credits have no repeated theme, lone episodes and specials with no season to compare against, and it sometimes starts on a sound cue that plays over the last shot. This change adds end-credit visuals: one keyframe pass over each episode's tail finds sustained text on a truly black background or on flat title cards, and combines that with the audio match.

This is part of a stacked series that adds local credits (outro) detection on a shared media sampling package. Review and merge in order; each PR targets the previous branch.

Approach

  • One pass per tail: a single ffmpeg run over the tail window reads keyframes only and produces per-keyframe blackness and signal statistics, silence intervals, and (when not cached) the Chromaprint fingerprint. The result is stored as a versioned credits_tail artifact. mediasample gains the statistics output, a generic metadata=print parser, a per-filter blackframe parser, and error classification.
  • Keyframe rules: a keyframe counts as text on black only when most of it is black at the file's own black level, not merely dark. Light, flat cards count separately. Dense credit columns and logos on black leave too little black to pass as a background; they count as "mostly black", which can join text keyframes into one run but never starts or ends one. Runs of credit-like keyframes need at least 15 s and mostly text.
  • Combining:
    • Chapter credits still win.
    • An audio match grows to cover overlapping text runs, and its start moves later to where the text begins when the story is still on screen.
    • A later text run that reaches the end of the file beats an audio match that doesn't.
    • Credits from visuals alone must end within 120 s of the end of the file.
    • Silence only moves a start inside the gap between the story and the credits.
  • Failures: files the probe shows have no video or an all-intra codec are skipped, decided from current probe metadata on each run so a probe repair brings them back. Sparse or excessive keyframes and undecodable tails are recorded as unusable; transient failures back off and retry. Season state records whether the tail pass ran, so an ffmpeg upgrade re-analyzes groups settled from audio alone, and an audio-only run never replaces results from a tail-capable run.

These rules were tuned on a 291-file validation sample of TV episodes and movies. Every start that looked early against TheIntroDB was checked against the actual frames, and none of the final rules' starts cut into the story. In the cases seen, TheIntroDB was itself often 5–16 s late.

Validation

  • Parser tests on sanitized jellyfin-ffmpeg 7.1.4 output, including joining filter lines by frame index; classification and combination tables that include the harmful cases found during validation (fading dark shots with a bright highlight, dark scenes, a spotlit stage, a sound cue before the credits, a recurring music cue before the real credits, post-credits scenes); a local ffmpeg integration test; unusable and failed backoff tests: pass.
  • The committed rules reproduce the validated prototype on the saved keyframe data: 99 of 99 episodes agree, and the Go audio matcher agrees on 138 of 138.
  • A regression case covers a movie whose dense credit columns split its credits into two runs 24 s apart, which placed the start 4.5 minutes late. On the validation sample the mostly-black class leaves every episode unchanged; of 42 movies with a reference, starts more than 10 s late drop from 13 to 9, with no new early starts.
  • On a 144-episode test library, the analysis wrote credits for 107 episodes from chapters, version copies, and audio with visuals. A frame check of 12 of them, taken across its seasons, found every start at the cut to credits.

Risks

A dark scene with a bright highlight can look like text on black. The strict-black rule, the text-share rule and the end-of-file rule guard against this; the per-keyframe statistics are cached, so the rules can be retuned without decoding again. Keyframe decoding adds CPU to each tail read (about 8 s for a 1080p H.264 episode in software); a later PR in this series moves it to the GPU where available.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code (in T3 Code), using its Workflow tool to run subagents
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5[1m] (main session), claude-opus-5-5 (implementation and review subagents)
  • Involvement: Fully AI-generated, not yet human verified
  • Adversarial review: A separate Claude Code review agent (claude-opus-5-5) independently re-ran the prototype comparison, checked the parsers against real jellyfin-ffmpeg output, the classification thresholds and combination order, artifact versioning, backoff, and that each tail is read once. It approved. Three minor follow-ups were left open: narrowing which stderr text counts as invalid data, spreading unusable-artifact writes, and including tail-scan availability in the credits analysis hash.

🤖 Generated with Claude Code

Note

Add end-credit detection to episode marker analysis with mediasample ffmpeg layer

  • Extends marker analysis from intro-only to intro and credits. Credits are placed from chapter titles, season-wide tail-audio fingerprints, and a video keyframe tail pass that classifies text-on-black frames. Marker writes are kind-aware via MarkerPatch, and each kind is analyzed and owned independently.
  • Adds the internal/mediasample package: structured sampling requests, a retrying ffmpeg runner, capability caching, a resizable concurrency limiter with a reserved interactive slot, and Linux background process priority. Chromaprint extraction and silence refinement now run through this shared layer.
  • Introduces generalized analysis artifacts (media_intro_fingerprints gains kind, status, failure, and retry metadata) with per-server failure backoff, plus distinct credits analysis hashes for season state. Lazy playback now detects missing credits when an intro exists and keeps on-demand online markers visible during local analysis. Admin v2 refresh analyzes both kinds; legacy endpoints stay intro-only.
  • Risk: database migration 20260926190719_generalize_media_analysis_artifacts.sql changes media_intro_fingerprints shape; rollback deletes non-intro/non-complete artifact rows. Also Repository.LoadSeasonState/UpsertSeasonState now take an explicit analysis hash instead of a Config, and the introRepository interface gained artifact and failure-recording methods.

Macroscope summarized f517a75.

Quick104 and others added 6 commits September 26, 2026 22:29
…tive starts

The silencedetect parser now reads silence_start and silence_end events in
output order and pairs each end with the most recent open start, instead of
matching them by index. Values may be negative or use an exponent because
ffmpeg prints them with %.6g; a negative window-relative start is clamped to
the window start, and an end with no open start is ignored. A table test
covers these cases along with a trimmed jellyfin-ffmpeg 7.1.4 excerpt.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The intro fingerprint table now stores per-file media analysis artifacts of any kind, with a status (complete, unusable, failed), failure backoff, and the server that recorded a failure. The migration only adds columns and keeps the primary key, so binaries from before this change keep reading and upserting intro fingerprints during a rolling deploy. The repository gains generic load, upsert, and failure methods, and the intro fingerprint methods become thin wrappers over them. This gives later analysis kinds, such as credits fingerprints, a place to cache results and failures without new tables.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ing package

Intro detection built its own ffmpeg argv, parsed silencedetect output, decoded raw Chromaprint, and limited concurrency inside intromarkers. That code now lives in internal/mediasample behind a typed, JSON-serializable Request and a Runner that records runs under a new analysis process-metrics workload, so later detectors and remote nodes can share it. Capability checks are cached per ffmpeg binary identity and reset alongside the tonemap probe cache on re-probe. Fingerprint output and silence events are unchanged against jellyfin-ffmpeg 7.1.4.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Local marker analysis now finds TV episode credits. It reads authored credits
chapters first, copies them to other versions of the same episode, and
otherwise compares a cached Chromaprint fingerprint of each episode's tail
across the season, writing only strong matches that reach the end of the file.
Each marker kind is owned separately, so higher-priority credits are never
overwritten and an online intro no longer blocks local credits. Playback
analysis asks only for the kinds the file lacks and keeps a settled credits
season, so an episode without detectable credits does not repeat the season
comparison on every start.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…O priority

Scheduled and admin-triggered intro/outro analysis now starts its ffmpeg child at nice 19 in the idle I/O class on Linux, so fingerprinting and silence refinement only use CPU and disk time that playback leaves free. Analysis started from playback keeps normal priority. The child is forked from a dedicated locked thread whose priority is lowered and then discarded, with a handoff when that goroutine lands on the main thread so the server itself never stays lowered. If the priority cannot be lowered, one warning is logged and the run continues; other platforms are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… windows

The local marker analyzer now takes a marker kind and a fingerprint window instead of assuming an intro at the start of the file. A markerKind enum drives candidate ownership, effective sources, and MarkerPatch writes, and candidates carry the credits marker columns. Matching bounds, confidences, and the algorithm label move into a per-kind matchProfile, and segments are offset by the window start. Intro detection keeps the same results and stored keys, so credits detection can build on this without a behavior change.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 56e0765a-2388-4847-bad8-a5e80b0ad46a

📥 Commits

Reviewing files that changed from the base of the PR and between 10284e8 and f517a75.

⛔ Files ignored due to path filters (1)
  • internal/mediasample/testdata/tail_stats.log is excluded by !**/*.log
📒 Files selected for processing (99)
  • docs/admin-catalog-api.md
  • docs/architecture/intro-detection.md
  • docs/architecture/media-sampling.md
  • docs/markers-api.md
  • docs/operations/profiling.md
  • internal/api/handlers/admin_intro.go
  • internal/api/handlers/admin_intro_test.go
  • internal/api/handlers/admin_marker_population.go
  • internal/api/handlers/playback.go
  • internal/api/handlers/playback_lazy_markers.go
  • internal/api/handlers/playback_lazy_markers_test.go
  • internal/database/media_analysis_artifacts_migration_test.go
  • internal/intromarkers/analyzer.go
  • internal/intromarkers/analyzer_credits.go
  • internal/intromarkers/analyzer_credits_tail.go
  • internal/intromarkers/analyzer_credits_tail_test.go
  • internal/intromarkers/analyzer_credits_test.go
  • internal/intromarkers/analyzer_parallel_test.go
  • internal/intromarkers/analyzer_test.go
  • internal/intromarkers/artifact.go
  • internal/intromarkers/artifact_db_test.go
  • internal/intromarkers/artifact_test.go
  • internal/intromarkers/chromaprint.go
  • internal/intromarkers/chromaprint_test.go
  • internal/intromarkers/compare.go
  • internal/intromarkers/compare_test.go
  • internal/intromarkers/credits.go
  • internal/intromarkers/credits_audio.go
  • internal/intromarkers/credits_chapter.go
  • internal/intromarkers/credits_chapter_test.go
  • internal/intromarkers/credits_combine.go
  • internal/intromarkers/credits_combine_test.go
  • internal/intromarkers/credits_guard.go
  • internal/intromarkers/credits_tail.go
  • internal/intromarkers/credits_tail_db_test.go
  • internal/intromarkers/credits_tail_test.go
  • internal/intromarkers/credits_test.go
  • internal/intromarkers/credits_video.go
  • internal/intromarkers/credits_video_test.go
  • internal/intromarkers/kind.go
  • internal/intromarkers/kind_db_test.go
  • internal/intromarkers/kind_test.go
  • internal/intromarkers/priority_linux_test.go
  • internal/intromarkers/repository.go
  • internal/intromarkers/repository_test.go
  • internal/intromarkers/silence.go
  • internal/intromarkers/silence_backfill_db_test.go
  • internal/intromarkers/silence_test.go
  • internal/intromarkers/slot_limiter.go
  • internal/intromarkers/tail_codec.go
  • internal/intromarkers/tail_codec_test.go
  • internal/intromarkers/testdata/credits_cases.txt
  • internal/intromarkers/types.go
  • internal/intromarkers/types_test.go
  • internal/intromarkers/window.go
  • internal/intromarkers/window_test.go
  • internal/markers/contribute_test.go
  • internal/markers/overlay.go
  • internal/markers/overlay_test.go
  • internal/markers/population.go
  • internal/markers/write.go
  • internal/markers/write_test.go
  • internal/mediasample/args.go
  • internal/mediasample/args_test.go
  • internal/mediasample/caps.go
  • internal/mediasample/caps_test.go
  • internal/mediasample/chromaprint.go
  • internal/mediasample/chromaprint_test.go
  • internal/mediasample/doc.go
  • internal/mediasample/ffmpeg_test.go
  • internal/mediasample/limiter.go
  • internal/mediasample/limiter_test.go
  • internal/mediasample/parse_blackframe.go
  • internal/mediasample/parse_metadata.go
  • internal/mediasample/priority_linux.go
  • internal/mediasample/priority_linux_test.go
  • internal/mediasample/priority_other.go
  • internal/mediasample/priority_other_test.go
  • internal/mediasample/reason.go
  • internal/mediasample/reason_test.go
  • internal/mediasample/request.go
  • internal/mediasample/request_test.go
  • internal/mediasample/run.go
  • internal/mediasample/run_test.go
  • internal/mediasample/silence.go
  • internal/mediasample/silence_test.go
  • internal/mediasample/stats.go
  • internal/mediasample/stats_test.go
  • internal/mediasample/stderr.go
  • internal/processmetrics/completed.go
  • internal/proxy/reprobe.go
  • internal/taskmanager/tasks/detect_intro_markers.go
  • internal/tonemap/preflight.go
  • internal/tonemap/probe.go
  • internal/transcodenode/reprobe.go
  • migrations/sql/20260926190719_generalize_media_analysis_artifacts.sql
  • web/src/components/admin/libraries/LibraryFormSections.tsx
  • web/src/pages/admin-settings/MarkerTasksCard.tsx
  • web/src/pages/setup-wizard/steps/FeaturesStep.tsx
 __________________________________________________________
< My fitness tracker wants me to tackle 10,000 bugs a day. >
 ----------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-27T18:58:36.637882Z 4e1e337 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread internal/intromarkers/analyzer.go Resolved
Comment thread internal/intromarkers/credits_video.go Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc7be6e4c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/intromarkers/credits.go Resolved

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

AI-assisted findings-only review with Codex desktop (gpt-6-astra) and GitHub CLI. The finding below was verified by tracing candidate selection, probe repair, and artifact reuse against the immediate base; no files were changed.

@macroscopeapp

macroscopeapp Bot commented Sep 27, 2026

Copy link
Copy Markdown

All directly affected marker-timing C1 rows are currently Not run, so there are no recorded passes to invalidate or failures to unblock. The Validation tasks: line is incomplete: this PR changes locally generated credits ranges returned by watch detail/live marker updates and consumed by Web, iOS/tvOS, and Android/Android TV playback. Mark #1149 C1 as changes, not relates, and include the four client C1 tasks.

Suggested fix — replace the line with:

Validation tasks: changes #1148 C1; changes #1149 C1; changes Silo-Server/silo-apple#311 C1; changes Silo-Server/silo-apple#312 C1; changes Silo-Server/silo-android#321 C1; changes Silo-Server/silo-android#322 C1

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

Episode credits now combine the season's ending-audio match with each file's end-credit visuals. One ffmpeg pass over the tail window samples keyframe blackness and signal statistics, silences, and the Chromaprint fingerprint, and the result is cached as a versioned credits_tail analysis artifact. Lone episodes and seasons without a shared ending theme can now get credits from visuals alone, while chapter credits still take precedence. Undecodable or unsuitable files are recorded as unusable; transient ffmpeg failures back off and are retried.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@Quick104
Quick104 force-pushed the outro/c3-credits-visuals branch from dc7be6e to 5a9eb80 Compare September 27, 2026 15:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a9eb80bfa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/intromarkers/credits_tail.go Resolved
@Quick104

Copy link
Copy Markdown
Contributor Author

Updated the Validation tasks: line: this PR changes locally detected credits ranges that the web, Apple, and Android clients consume, so all six C1 tasks are now listed as changes. #1541 got the same correction.

Quick104 and others added 14 commits September 27, 2026 11:55
…ilure

RecordArtifactFailure locked the artifact row before deciding whether a
failure may replace it, but that lock covers nothing when the row does not
exist yet. Another server's first complete result, inserted in that gap, was
then overwritten by the failure upsert. Without a row, the failure is now
inserted only if the key is still free; if a row appeared meanwhile, it is
locked and judged again, so a settled result for the same file stands.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…a timer

assertWaiting treated a 20 ms timeout as proof that Acquire was blocked,
so a goroutine the scheduler had not yet run could pass as waiting. The
asynchronous limiter tests now run in a synctest bubble and call
synctest.Wait, which returns only once the Acquire goroutine is durably
blocked or done. acquireAsync closes its channel when Acquire fails, so
an error is not mistaken for waiting.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A tail ruled out by probe metadata (no video codec, or an all-intra
codec) was stored as an unusable credits_tail row keyed only by file
hash, size, and duration. A probe repair that later filled in or
corrected the codec left the row in force, so the file was never
sampled, even on a forced refresh. The write also ran before the ffmpeg
limiter, so a large season of such files issued one concurrent upsert
per file.

The check is now made from current metadata on every analysis and never
stored. A row an earlier build stored this way is treated as missing
when met. The credits season state's input signature covers the same
check, so a settled group is analyzed again after a repair.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A season group analyzed while ffmpeg lacked the tail-pass filters was
settled under the same analysis hash a tail-capable run uses. After an
ffmpeg upgrade, or on a capable server in a mixed cluster, the group was
skipped as settled and never got visual credits until its files changed
or an admin forced a refresh.

CreditsAnalysisConfigHash now covers the tail key only when the analysis
ran tail passes, so each mode keeps its own settled state.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…e missing kind

With markers.online_storage set to on_demand, playback's marker updates reloaded the stored row before and after local analysis, so players lost the online intro or credits they had just been shown, and local analysis was asked for a kind the player already had. The playback handler now keeps the on-demand lookup and lays its online and plugin markers back over each reload with the new markers.OverlayOnline, which uses the same precedence as ApplyResult: manual markers still win, and a fresh lookup replaces an online marker left over from stored mode. Missing kinds are worked out from the file players see, so an online intro sends local analysis after credits only. Stored mode is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… black

The black-level comment said the percentile skips broken keyframes,
which holds only for tails of 200 or more keyframes. Shorter tails use
their darkest keyframe on purpose, as TestTailBlackLevel pins.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ing version

A credits chapter followed by its own chapter, such as a post-credits scene, now ends where that chapter starts even within 15 seconds of the end of the file; only the last chapter's end snaps to the end. Before, Skip Credits jumped over the authored scene. A version of an episode without chapters now copies chapter credits from the chapter-bearing version whose duration it matches, not from whichever was listed first, which rejected valid copies when an episode had several chapter-bearing versions.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
When a credits marker failed to write, the season group was still recorded as complete, so scheduled and playback analysis skipped it until its inputs changed and the missing marker was never retried. The group is now recorded as failed, which is not settled, so the next run analyzes it again. settleSeasonState keeps a failed status instead of turning it into partial, which would settle the group for a week.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Admin refresh started analyzing credits as well as intros for every caller, which changed the frozen /api/v1 refresh-markers and redetect-intro routes and the v2 redetect-intro port of them. Those now analyze episode intros only, as before credits existed. Only v2 refresh-markers, in local and both modes, runs intro and credits analysis. The analyzer gains AnalyzeEpisodeKinds so the handler chooses the kinds.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
With credits season state keyed by tail mode, a server that cannot run
tail passes found no state of its own for a group a tail-capable server
had settled. It re-analyzed the group, and its credits-audio:v1 result
could replace the credits-audio:video:v1 marker, since both are one
scored family. The capable server's state still matched, so it never
restored the marker.

An unforced run without tail passes now also skips a group settled under
the tail-mode hash. A tail-capable run still checks only its own hash,
so groups settled audio-only are analyzed again once tail passes work.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	internal/intromarkers/analyzer_credits.go
#	internal/intromarkers/analyzer_test.go

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93c278e3bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Quick104 and others added 4 commits September 27, 2026 12:24
…m playback reloads

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ffmpeg fails the whole combined tail run when its audio output finds no
stream, so a file whose probe metadata named audio it cannot give had its
usable video tail stored as permanently unusable. The tail pass now runs
the video alone after a no_stream failure; when that succeeds the tail is
kept and the fingerprint is stored as having no audio. A pass that still
finds no stream lacks video, so the audio-only run decides the fingerprint
instead of assuming there is no audio.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…k and lookups

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f517a757f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Base automatically changed from outro/c2-episode-credits to main September 27, 2026 18:51
# Conflicts:
#	docs/architecture/intro-detection.md
#	docs/architecture/media-sampling.md
#	docs/markers-api.md
#	internal/api/handlers/admin_intro.go
#	internal/api/handlers/playback_lazy_markers.go
#	internal/intromarkers/analyzer.go
#	internal/intromarkers/analyzer_credits.go
#	internal/intromarkers/analyzer_credits_test.go
#	internal/intromarkers/analyzer_test.go
#	internal/intromarkers/chromaprint_test.go
#	internal/intromarkers/credits.go
#	internal/intromarkers/credits_audio.go
#	internal/intromarkers/credits_test.go
#	internal/intromarkers/types.go
#	internal/mediasample/args.go
#	internal/mediasample/args_test.go
#	internal/mediasample/caps.go
#	internal/mediasample/caps_test.go
#	internal/mediasample/doc.go
#	internal/mediasample/ffmpeg_test.go
#	internal/mediasample/request.go
#	internal/mediasample/request_test.go
#	internal/mediasample/run.go
@kody-ai

kody-ai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Access your configuration settings here.

@Quick104
Quick104 merged commit 00b15bc into main Sep 27, 2026
9 of 16 checks passed
@Quick104
Quick104 deleted the outro/c3-credits-visuals branch September 27, 2026 18:52
func (e *ChromaprintExtractor) PreflightCreditsTail(ctx context.Context) error {
caps, err := mediasample.LoadCapabilities(ctx, e.config.FFmpegPath)
if err != nil {
return err

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Kody Rules medium

Unwrapped error returned in PreflightCreditsTail from mediasample.LoadCapabilities, which loses context about which operation failed and breaks the error chain convention, making production debugging harder. Wrap the error with fmt.Errorf and the %w verb, e.g. return fmt.Errorf("loading ffmpeg capabilities from %s: %w", e.config.FFmpegPath, err).

Kody rule violation: Wrap errors with context using fmt.Errorf with %w

return fmt.Errorf("loading ffmpeg capabilities from %s: %w", e.config.FFmpegPath, err)

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e1e33752f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

BlackThresholds: creditsBlackThresholds,
}
}
if candidate.hasAudio() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Invalidate video-only tails when audio metadata is repaired

When a file temporarily has an empty CodecAudio even though it contains audio, this branch stores a complete tail artifact containing frames but no silences. A later probe repair can populate codec_audio without changing the media bytes, but neither the artifact identity nor creditsInputSignature includes audio availability, so scheduled analysis skips the settled group and even forced analysis reuses the incomplete artifact. Video-only credits therefore permanently miss silence-based boundary refinement until the file or artifact configuration changes; include audio presence in invalidation or resample tails cached without audio after the metadata changes.

Useful? React with 👍 / 👎.

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.

feat(markers): detect credits for episodes

1 participant