Search code examples
videomkv

recognize broken movies that do not play back completely


i have a broken hard drive from which i have now copied all the saved movies. but some are broken. This manifests itself only so that the film can not be played to the end. before that it works fine. i have now tried a few programs that allow me to quickly filter out these broken movies, but my most successful one (HBBatchBeast) does not recognize this type of error. Do you have a suggestion on how I can automate it without clicking on each movie, skipping to the end and seeing if it breaks.

https://github.com/HaveAGitGat/HBBatchBeast tests the movies with HandBrake and FFmpeg/FFprobe


Solution

  • The damage to the video file could be at any point so to check it you unfortunately have to go through the entire video.

    Possibly the quickest approach would be to use ffmpeg - if you ask it to re-encode a video to null it should simply read in the file, reporting any errors that it finds and then ignore each frame it has read. As it is doing very little work other than decode it should be quite quick.

    You can test on a known working and a known broken file first to ensure it catches your errors:

    ./ffmpeg -v error -I yourVideoFile.mp4 -f null - 2>error.log

    Have a look at some of the discussion here to get a feeling for other approaches and also wrapping into a script: https://superuser.com/a/338708