1.6 KiB
id, title, status, assignee, created_date, updated_date, labels, dependencies
| id | title | status | assignee | created_date | updated_date | labels | dependencies | |
|---|---|---|---|---|---|---|---|---|
| task-86 | Fix WebmOrMp4 frame extraction near end of video | Done |
|
2025-08-14 | 2025-08-14 |
Description
The WebmOrMp4 class fails to extract frames near the end of videos due to imprecise seeking calculations when using -sseof parameter. This causes test failures when trying to extract the last frame of MP4 files.
Acceptance Criteria
- Frame extraction works for all frames including the last frame
- Test passes for MP4 files when extracting different frames
- No regression in existing webm frame extraction functionality
Implementation Plan
- Analyze the current frame seeking logic and identify the root cause\n2. Research alternative approaches for seeking near the end of videos\n3. Implement a more robust seeking strategy\n4. Test the fix with the failing MP4 test case\n5. Verify no regressions with existing webm tests
Implementation Notes
Fixed the WebmOrMp4 frame extraction issue by simplifying the seeking logic. The previous implementation used complex logic to determine whether to seek from the beginning (-ss) or from the end (-sseof) of the video, but seeking from the end was causing failures when trying to extract frames near the end of short videos. The fix removes this complexity and always seeks from the beginning with a small safety margin (0.01s) for the last frame to prevent seeking beyond the video duration. This approach is more reliable and the performance difference is negligible. All tests now pass including both MP4 and webm functionality.