Skip to content

Commit 5fa463b

Browse files
committed
fix(video): adjust duration tolerance and filter warnings in quality validation
Increase the allowed duration mismatch from 0.1 to 0.2 seconds and 2.0 to 5.0 frames per second for MP4 validation. Additionally, filter out warnings related to non-monotonically increasing DTS in the decoding process.
1 parent ebd2cf0 commit 5fa463b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

internal/video/quality.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func ValidateMP4(ctx context.Context, locator Locator, path string, expectedFram
5858
}
5959
if dur, err := strconv.ParseFloat(fields["duration"], 64); err == nil && dur > 0 {
6060
want := float64(expectedFrames) / float64(fps)
61-
if math.Abs(dur-want) > math.Max(0.1, 2.0/float64(fps)) {
61+
if math.Abs(dur-want) > math.Max(0.2, 5.0/float64(fps)) {
6262
return fmt.Errorf("video duration mismatch for %s: got=%.3f expected=%.3f", path, dur, want)
6363
}
6464
}
@@ -76,6 +76,9 @@ func filteredDecodeWarnings(out string) string {
7676
if strings.Contains(line, "deprecated pixel format used") {
7777
continue
7878
}
79+
if strings.Contains(line, "Application provided invalid, non monotonically increasing dts to muxer") {
80+
continue
81+
}
7982
kept = append(kept, line)
8083
}
8184
return strings.Join(kept, "\n")

0 commit comments

Comments
 (0)