Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.

Commit cde2074

Browse files
committed
Logs time delta when file is corrupted
1 parent f4d8c3e commit cde2074

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Wasari.FFmpeg/FFmpegService.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,14 @@ public async Task<bool> CheckIfVideoStreamIsValid(string filePath)
205205
}
206206

207207
var delta = fileAnalysis.Duration - videoDuration;
208-
return videoDuration >= fileAnalysis.Duration || delta < TimeSpan.FromSeconds(10);
208+
var isValid = videoDuration >= fileAnalysis.Duration || delta < TimeSpan.FromSeconds(10);
209+
210+
if (!isValid)
211+
{
212+
Logger.LogWarning("File was found to be invalid: {FilePath}, the difference between the video duration and the file duration is {Delta}", filePath, delta);
213+
}
214+
215+
return isValid;
209216
}
210217
catch (Exception e)
211218
{

0 commit comments

Comments
 (0)