Skip to content

Some Matroska/webm videos yield zero extracted frames (empty output / 500) #390

Description

@keighrim

Running app-swt-detection (v8.6, classifier path) over some Matroska/webm videos extracts zero frames: the classifier loop never runs and the request ends in a 500 with TypeError: 'NoneType' object is not iterable at the output stage. Root cause not yet confirmed. I observed the frameCount value is correct immediately after vdh.capture() (cv2-based video reader code), but the value used a few lines later to compute the total timeline has become 0, so the image extraction start/end window is 0..0 and nothing is sampled. With zero frames classified, the result accumulator stays None and the output loop (which has no empty-input guard) raises the TypeError.

Suspected area

After the PyAV migration (#379) , SWT's classifier path still uses the older cv2-backed helpers (vdh.capture, vdh.extract_frames_as_images) alongside newer code (vdh.get_framerate, tuh.convert). The frameCount appears correct when cv2 sets it but 0 by the time it is consumed, so a mismatch between the cv2 and PyAV code paths (or between how a document property is written vs. read) is the leading suspect. Not confirmed.

Open questions

  • Why does frameCount change from a correct value to 0 between being set and being read, with no explicit reset in between?
  • Is the collapse specific to the cv2 path, the PyAV path, or their interaction?
  • Independent of the above: SWT should handle "zero frames extracted" gracefully rather than 500-ing with an opaque TypeError.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions