Skip to content

[bug] ffprobe's low-confidence format guesses are stored as a damaged file's metadata #2862

Closed

Description

@Quick104

What happened

When ffprobe can only guess a file's format, Silo stores the guess as the file's real metadata. ffprobe exits 0 for some damaged files after detecting a format "only with low score", and Silo reads format_name without checking probe_score.

An AVI whose first 4 KiB are damaged probes as a bare MPEG-4 video stream (m4v) with probe_score 5. Silo catalogs it as container m4v with video only, dropping the audio the file still holds. A file ffprobe refuses outright is marked as rejected instead, and playback reports that the file is damaged. A low-score guess skips that path.

Seen 1 of 1 damaged AVI files on a dev deployment.

Steps to reproduce

  1. Make a damaged AVI:
    ffmpeg -f lavfi -i testsrc=size=640x360:rate=24:duration=6 -f lavfi -i sine=duration=6 -c:v mpeg4 -c:a mp3 -shortest good.avi
    cp good.avi broken.avi
    head -c 4096 /dev/urandom | dd of=broken.avi bs=4096 count=1 conv=notrunc
    
  2. ffprobe -v warning -print_format json -show_format -show_streams broken.avi exits 0 and prints:
    [m4v @ 0x5ce195235940] Format m4v detected only with low score of 5, misdetection possible!
    
    with "format_name": "m4v", "probe_score": 5, one mpeg4 video stream and no audio stream.
  3. On a Silo dev deployment, put it in a Movies library as Broken Header (2019)/Broken Header (2019).avi and scan.
  4. Read the row: SELECT regexp_replace(file_path, '.*/', '') f, base_type, container, codec_video, codec_audio, duration, probe_failed_at IS NOT NULL rej FROM media_files WHERE file_path LIKE '%Broken Header%'.

Result:

            f             | base_type | container | codec_video | codec_audio | duration | rej
--------------------------+-----------+-----------+-------------+-------------+----------+-----
 Broken Header (2019).avi | movie     | m4v       | mpeg4       |             |        6 | f

Expected behavior

A probe that only guessed the format (a score at or below ffmpeg's AVPROBE_SCORE_RETRY, 25) should count as ffprobe rejecting the file, as a non-zero exit does today: the row is marked probe_failed_at, the same bytes are not re-probed by scans, and playback reports a damaged file.

In a sample of healthy files, every one scored 50 or higher with ffprobe 8.1.3: MP3 with and without ID3 tags, MP3 with a junk prefix, a 1-second MP3, ADTS AAC, FLAC, M4B, Opus, a raw MPEG-2 elementary stream, and short MPEG-TS. A truncated MPEG-PS scored 26.

Silo version / commit

0ae2e06ef (main)

Deployment

Docker Compose dev sandbox

Clients affected

Other/not client-specific

Relevant logs

Silo runs ffprobe with -v error, so the "detected only with low score" warning is not logged; no Silo logs available for this.

Technical notes

  • ffprobeFormat (internal/scanner/probe.go) has no probe_score field, and nothing in internal/ reads it.
  • IsProbeRejection (internal/scanner/probe.go) only treats a non-zero ffprobe exit as a rejection.
  • ffprobe 8.1.3-Jellyfin was used for the measurements above.
  • A focused test fails on main: the low-score rows in TestIsProbeRejectionSeparatesRefusedFilesFromProbeTrouble.

AI harness

Claude Code

AI tool(s)

Claude Code (/silo skill)

AI model(s)

claude-opus-5-5

AI involvement

AI reproduced the problem on a dev deployment and drafted this issue.

Independent or adversarial review

n/a

Confirmations

  • I searched open and recently closed issues and pull requests, and this is not already reported
  • I reproduced this myself on a real deployment
  • Any logs provided are raw apart from marked redactions and are not AI-summarized; if none were available, I said so above

Source: internal review of the scanner

Activity

  1. added
    bug
    on Oct 21, 2026
  2. self-assigned this
    on Oct 21, 2026
  3. Quick104 commented on Oct 21, 2026

    @Quick104
    ContributorAuthor

    🤖 AI agent claim. Claude Code (claude-opus-5-5) 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.

  4. added
    impact: playback
    priority: P2
    on Oct 21, 2026
  5. added 4 commits that reference this issue on Oct 21, 2026
    40791f2
    98d87e1
    c759a42
    a856fd8
  6. added a commit that references this issue on Nov 5, 2026
    9c51b9f
  7. added a commit that references this issue on Nov 13, 2026
    5ac30bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugimpact: playbackpriority: P2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions