Dealing with process management, sometimes it is completely unacceptable for a batch job to NOT fail if part of the task cannot be completed. When the files are dependent upon each other being correct, one of them being bad means all of them are useless.skyy99 wrote:But it's real task is more akin to a batch job that processes each independent second of video data. In a batch job it is completely unacceptable to terminate the entire process if one independent piece fails. A batch job must complete and provide a log of what succeeded and what did not succeed. Each second of video is rather independent from the previous in terms of how it's being used (and even from an encoding perspective to some extent).
In this case, you have files (titles) that are made up of interleaved data streams. A bad block may affect any or all of them. Faking data for bad areas is the "batch job" equivalent is that it copies most parts of most files, and declaring the result a "success". Which files are bad? Some. But which ones? I don't know, you figure it out.
Or a different example. Failing hard drive. Operating system says it is bad, and won't talk to it. Is all the data lost?
Not necessarily. There are tools out there that will read the entire drive to another drive (or a drive image), substituting zeros for any bad sectors. But, is the result valid, bootable, and useable? Maybe, maybe not. Depends on where the zeros were written.
Can it be recovered? Depends on your available tools, and how much time you want to expend on it. Last time I did such a recovery, it took a WEEK to get 90% of the data off a 1TB drive.
If you want to have a program that accepts damage, MakeMKV isn't it. Maybe what IS it is a combination of a program (like "dd" on Linux) that can be told to replace "unknown data corruption" with "known data corruption" (zeros for bad sectors), then something like MakeMKV that will try to make sense of the damaged-but-now-all-readable image file.
Having watched MakeMKV work, there is nothing fast about it failing. If you tell it to retry 25 times instead of the normal 5, it will repeatedly request the bad sectors, trying to get the data from the DVD or BD.PROs:
1) Fast fail is simple to code.
True "recover what you can" requires being able to get to the hardware - "Even if what you read fails consistency checks, give it to me anyway." Accessing the drive through the operating system (like MakeMKV does), you get back "FAILURE" and no data.
Players aren't tolerant when given corrupted files. I have yet to see one SKIP an error; they all just stop at the point of the error. You can test this yourself - take a copy of a working MKV or MP4 file, and randomly replace 2K of it with zeros. Try playing it with a player that is tolerant of errors in physical media. And it is rare that 1 bit is bad - it will be a multiple of 2048x8 bits.