# Video Processing Tests **Task**: AZ-143_test_video **Name**: Video Processing Tests **Description**: Implement E2E tests verifying video frame sampling, annotation interval enforcement, and movement-based tracking **Complexity**: 3 points **Dependencies**: AZ-138_test_infrastructure, AZ-142_test_async_sse **Component**: Integration Tests **Jira**: AZ-143 **Epic**: AZ-137 ## Problem Video detection processes frames at a configurable interval (frame_period_recognition), enforces minimum annotation intervals (frame_recognition_seconds), and tracks object movement to avoid redundant annotations. Tests must verify these three video-specific behaviors work correctly. ## Outcome - Frame sampling verified: only every Nth frame processed (±10% tolerance) - Annotation interval enforced: no two annotations closer than configured seconds - Movement tracking confirmed: annotations emitted on object movement, suppressed for static objects ## Scope ### Included - FT-P-10: Video frame sampling processes every Nth frame - FT-P-11: Video annotation interval enforcement - FT-P-12: Video tracking accepts new annotations on movement ### Excluded - Async detection initiation (covered in async/SSE tests) - SSE delivery mechanics (covered in async/SSE tests) - Video processing performance (covered in performance tests) ## Acceptance Criteria **AC-1: Frame sampling** Given a 10s 30fps video (300 frames) and frame_period_recognition=4 When async detection is triggered Then approximately 75 frames are processed (±10% tolerance) **AC-2: Annotation interval** Given a test video and frame_recognition_seconds=2 When async detection is triggered Then minimum gap between consecutive annotation events >= 2 seconds **AC-3: Movement tracking** Given a test video with moving objects and tracking_distance_confidence > 0 When async detection is triggered Then annotations contain updated positions for moving objects And static objects do not generate redundant annotations ## Non-Functional Requirements **Performance** - Video processing completes within 120s ## Integration Tests | AC Ref | Initial Data/Conditions | What to Test | Expected Behavior | NFR References | |--------|------------------------|-------------|-------------------|----------------| | AC-1 | Engine warm, SSE connected, test-video, frame_period=4 | Count processed frames via SSE | ~75 frames (±10%) | Max 120s | | AC-2 | Engine warm, SSE connected, test-video, frame_recognition_seconds=2 | Measure time between annotations | >= 2s gap between annotations | Max 120s | | AC-3 | Engine warm, SSE connected, test-video, tracking config | Inspect annotation positions | Updated coords for moving objects | Max 120s | ## Constraints - Test video must contain moving objects for tracking verification - Frame counting tolerance accounts for start/end frame edge cases - Annotation interval measurement requires clock precision within 0.5s ## Risks & Mitigation **Risk 1: Inconsistent frame counts** - *Risk*: Frame sampling may vary slightly depending on video codec and frame extraction - *Mitigation*: Use ±10% tolerance as specified in test spec