Add strict mode for video corruption detection#453
Open
IanButterworth wants to merge 2 commits into
Open
Conversation
ebed2a4 to
40e75f0
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #453 +/- ##
==========================================
- Coverage 80.05% 79.45% -0.60%
==========================================
Files 10 10
Lines 1499 1504 +5
==========================================
- Hits 1200 1195 -5
- Misses 299 309 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
40e75f0 to
9e58574
Compare
Add a `strict::Bool = false` keyword to `openvideo` / `VideoReader`. When enabled, the underlying codec context is opened with `AV_EF_EXPLODE | AV_EF_CRCCHECK | AV_EF_BITSTREAM`, so bitstream / CRC errors propagate out of `avcodec_receive_frame` instead of being silently concealed. These errors surface to the caller as a `VideoCorruptionError`. This makes decoding deterministic across FFmpeg versions for callers that need data integrity (no synthetic pixels from error concealment), while the default behaviour is unchanged. - Export `VideoCorruptionError` - Set `err_recognition` flags before `avcodec_open2` when `strict=true` - Wrap the existing decode-error path in `decode()` to throw `VideoCorruptionError` instead of a plain `error()` when strict - Documentation in `docs/src/reading.md` and `CHANGELOG.md` - Tests covering the new keyword, exception type, normal-mode pass-through, and corruption detection via a malformed H.264 Annex-B bitstream
9e58574 to
7e0b009
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a
strict::Bool = falsekeyword toopenvideo/VideoReader. When enabled, the underlying codec context is opened withAV_EF_EXPLODE | AV_EF_CRCCHECK | AV_EF_BITSTREAM, so bitstream / CRC errors propagate out ofavcodec_receive_frameinstead of being silently concealed. These errors surface to the caller as aVideoCorruptionError.This makes decoding deterministic across FFmpeg versions for callers that need data integrity (no synthetic pixels from error concealment), while the default behaviour is unchanged.
VideoCorruptionErrorerr_recognitionflags beforeavcodec_open2whenstrict=truedecode()to throwVideoCorruptionErrorinstead of a plainerror()when strictdocs/src/reading.mdandCHANGELOG.md