AydinAdn / MediaToolkit

A .NET library to convert and process all your video & audio files.
MIT License
647 stars 199 forks source link

Checking video integrity #104

Open vpenades opened 4 years ago

vpenades commented 4 years ago

Is it possible to test a video file to know if the video is fine, or if it's been corrupted or incomplete?

dannylloyd commented 4 years ago

@vpenades I have been doing this by checking the duration of the original video and the converted video afterward, if they durations are within an allowance then I deem it a success.

vpenades commented 4 years ago

Thanks for the suggestion, but that's not useful to me since what I want is to do an integrity check of any video, not from videos I previously encoded, so I cannot do that kind of comparison.

AydinAdn commented 4 years ago

I found this, how-can-i-check-the-integrity-of-a-video-file-avi-mpeg-mp4, however there's no "easy" way of doing that at the moment with this library.

If I'm completely honest, the entire library needed an overhaul a long time ago and I've only just recently got around to doing it. You can check its progress here MajorRefactoring. If you decide to check it out, look at the MediaToolkit.Core.Test project first, MediaToolkit its self is going to be completely deprecated and moving forwards will be removed.

With the new library it's a lot easier to test random FFmpeg arguments you find online as all responses from ffmpeg is logged, there's a default implementation in the MediaToolkit.Core.Test project that prints the responses to the console so you could tinker with it even now

vpenades commented 4 years ago

I'll give it a try, thanks!