Skip to content

Fix AV1 validation false positives for "Corrupt frame detected" errors#396

Merged
ShaneIsrael merged 2 commits intodevelopfrom
copilot/improve-av1-file-validation
Jan 20, 2026
Merged

Fix AV1 validation false positives for "Corrupt frame detected" errors#396
ShaneIsrael merged 2 commits intodevelopfrom
copilot/improve-av1-file-validation

Conversation

Copy link
Contributor

Copilot AI commented Jan 20, 2026

AV1 files were incorrectly rejected during transcode validation when ffmpeg reported "Corrupt frame detected" or "No sequence header" errors. These are known false positives for AV1 files with temporal scalability or non-standard sequence header placement—files play correctly but fail validation.

Changes

  • Restructured AV1 validation logic to check for false positives regardless of ffmpeg return code (previously only handled when returncode == 0)
  • Track known false positives separately from real corruption indicators
  • Pass validation if only false positives are found, even with non-zero exit code
  • Fail appropriately when returncode is non-zero with empty stderr

Behavior

Scenario Before After
AV1 file + "Corrupt frame detected" + returncode=1 ❌ Rejected ✅ Passes
AV1 file + "moov atom not found" + returncode=1 ❌ Rejected ❌ Rejected
Non-AV1 file + "Corrupt frame detected" ❌ Rejected ❌ Rejected

Known AV1 false positive indicators:

  • Corrupt frame detected
  • No sequence header
  • Error submitting packet to decoder
  • Decode error rate
  • Invalid NAL unit size
  • non-existing PPS
Original prompt

When trying to transcode some AV1 encoded files I get this error. The files play just fine so I know they are not corrupted. Is there some way we can better detect a working av1 file and attempt to transcode it than what is already being done?

2026-01-19 18:48:12,844 INFO cli.transcode_videos:569 | Transcoding 034fa386784a4b15c0d47bfa3446fc17 to 720p
2026-01-19 18:48:13,384 ERROR util.transcode_video_quality:503 | Source video validation failed: Video file appears to be corrupt: Corrupt frame detected


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

When validating AV1 files, be more lenient about known false positive
error messages like "Corrupt frame detected" or "No sequence header".
These can occur during initial frame decoding of valid AV1 files but
don't indicate actual file corruption.

The fix restructures the validation logic so that for AV1 source files:
1. Known false positive indicators are tracked separately
2. Real errors still cause immediate failure
3. If only false positives are found (regardless of returncode), file is valid
4. If returncode is non-zero with no known indicators, it fails appropriately

Co-authored-by: ShaneIsrael <[email protected]>
Copilot AI changed the title [WIP] Improve detection for working AV1 encoded files Fix AV1 validation false positives for "Corrupt frame detected" errors Jan 20, 2026
Copilot AI requested a review from ShaneIsrael January 20, 2026 01:54
@ShaneIsrael ShaneIsrael marked this pull request as ready for review January 20, 2026 01:55
@ShaneIsrael ShaneIsrael merged commit 8a7b9e3 into develop Jan 20, 2026
@ShaneIsrael ShaneIsrael deleted the copilot/improve-av1-file-validation branch January 20, 2026 06:16
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.

2 participants