aetaric / aetaric/checkrr

[Feature] FFmpeg quick sampling: multi-window decoding to detect localized corruption

未关闭
#150 0 条评论 1 个 reaction 已指派 1 人 已被 @aetaric 认领 在 GitHub 查看
enhancement
主要语言
Go
星标
578
派生
17
PR 合并指标
30 天内没有已合并 PR

描述

**Is your feature request related to a problem? Please describe.**

The current FFmpeg quick check only decodes the first N seconds of a media file (for example `-t 120` from the beginning)
This could creates blind spots: localized corruption occurring later in the file (or near the end) is never detected
Increasing the decoded duration (or running a full scan) is not viable due to CPU and time constraints

---

**Describe the solution you'd like**

Add a *ffmpeg-quick-windows* parameter that replaces a single contiguous decode with multiple short decoding windows spread across the media duration

Instead of decoding N seconds from the start, it could:
- Decode a small number of short windows
- Automatically spread them across the file (early / middle / late)
- Keep the total decoded time low

Example behavior and configuration:
- 5 windows × 5 seconds at 0%, 25%, 50%, 70%, 90%
```json
# keep existing seconds parameter
ffmpeg-quick-seconds: 5
# number of decode samples (default: 1 - current behavior)
ffmpeg-quick-windows: 5
```

Any error or timeout in one of the windows would mark the file as corrupted or suspect

---

**Describe alternatives you've considered**

- Increasing the `ffmpeg-quick-seconds` value: improves coverage, but with a very poor cost-to-efficiency ratio
- Running a full FFmpeg decode on all files: reliable but not possible for large libraries
- Relying on ffprobe only: fast but does not detect all decoding-time or playback issues

---

**Additional context**

This feature is intended to improve corruption detection in very large media libraries without significantly increasing CPU usage

Implementation concerns / edge cases:
- Libraries with very different media duration will get inconsistent coverage if the number of windows is fixed; scaling the window count automatically based on duration (or providing sensible presets for “short/medium/long” content) would improve consistency
- It may be possible to determine the number of windows automatically based on the media duration, so that enabling a single flag like `ffmpeg-quick-sampling: true` would be sufficient for most users (with optional advanced overrides maybe?)
- This feature likely requires `ffprobe` (or equivalent) to retrieve the media duration in order to compute sampling offsets; if duration is unavailable or invalid, the implementation could fall back to the current behavior (single window from the start)
- Short files where multiple windows would overlap or exceed total duration: the sampler should clamp offsets and avoid re-scanning already covered ranges

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。