Repository navigation
Backlog
Labels
canonicalChanges something consumers rely on: finding codes, snapshot format, written filesconsumer: deeplabcutNeeded by or affects DeepLabCutconsumer: napariNeeded by or affects napari-deeplabcutio: videoVideo readingvalidationDiscovery, validation, findings and snapshots
Description
Deferred from #12, which only bridges capability gaps with DeepLabCut's VideoReader.
Potentially useful fixes that would alter behavior are listed below.
Findings
Fixtures from tests/io/test_video.py (60 frames, MJPG, mp4v and H.264), with 400 bytes zeroed mid-file, on OpenCV 5.1.
1. OpenCV's seek can land on another frame
On damaged MJPG, seeking to 30, 35 or 40 decodes frame 29, and OpenCV fails silently. DeepLabCut's VideoReader seeks the same way.
CAP_PROP_POS_MSECafter the read exposes it: 2900 ms where 4000 ms is expected. On undamaged files it matchedindex / fpsfor every seek tested.- Checking it by default would reject variable-frame-rate videos, common in phone footage.
- Options: opt-in check (
Video(path, verify_seeks=True)) raising on mismatch; a warning; no change.
2. Iteration ends silently at damage
Video.frames() stops at the first failed read.
DeepLabCut's VideoReader.read_frame() returns None there, which its callers wrongly treat as the end.
- Option: on a failed read, try a few more reads, and raise if one succeeds; frame indices after the gap are unknown, so raising is the only correct outcome.
- Limit: damage spanning more reads than the retry budget still looks like the end.
3. Certain detection
Decoding the whole file with ffmpeg -v error -f null -, as DeepLabCut's VideoReader.check_integrity does, finds all damage. Too slow for Video; candidate for project video validation.
Metadata
Metadata
Assignees
Labels
canonicalChanges something consumers rely on: finding codes, snapshot format, written filesconsumer: deeplabcutNeeded by or affects DeepLabCutconsumer: napariNeeded by or affects napari-deeplabcutio: videoVideo readingvalidationDiscovery, validation, findings and snapshots
Activity
[-]`Video`: decide the behaviour on damaged videos[/-][+]`Video`: decide the behavior on damaged videos[/+]