BD_to_AVP icon indicating copy to clipboard operation
BD_to_AVP copied to clipboard

MakeMKV errors pass through

Open ddevler opened this issue 11 months ago • 11 comments

The script does not pass through errors from MakeMKV. After I encoded a movie, I went play it back there were jumps in the playback. I didn't know there were errors until I tried to manually rip the disc using makemkv. Kids movie so apparently there were quite few scratches in the disc.

Example errors: The source file '/BDMV/STREAM/00902.m2ts' is corrupt or invalid at offset 8744417280, attempting to work around The source file '/BDMV/STREAM/00902.m2ts' is corrupt or invalid at offset 8744417280, attempting to work around The source file '/BDMV/STREAM/00902.m2ts' is corrupt or invalid at offset 8744417280, attempting to work around The source file '/BDMV/STREAM/00902.m2ts' is corrupt or invalid at offset 8744417280, attempting to work around The source file '/BDMV/STREAM/00902.m2ts' is corrupt or invalid at offset 8744417280, attempting to work around The source file '/BDMV/STREAM/00902.m2ts' is corrupt or invalid at offset 8744417280, attempting to work around The source file '/BDMV/STREAM/00902.m2ts' is corrupt or invalid at offset 8744417280-8744423424, attempting to work around The source file '/BDMV/STREAM/00902.m2ts' is corrupt or invalid at offset 8744423424, attempting to work around

ddevler avatar Mar 25 '24 22:03 ddevler

Interesting, so the original disc has issues so the encoded movie has skips? What would you suggest happen? Stop or pause on corrupt messages from MakeMKV?

cbusillo avatar Mar 25 '24 22:03 cbusillo

I'm not sure the behavior on that one. MakeMKV just displays bunch errors and continues on. When watch the movie it jumps a few minutes where the scratches are. Maybe just print out a message saying where X number of errors ripping the disc. An indicator so you know was problem. Unless you want go further and add a pause or stop on errors option.

ddevler avatar Mar 25 '24 22:03 ddevler

Where did you get the errors from? Running MakeMKV manually? do you know if they are printed to stdout or stderr?

cbusillo avatar Mar 25 '24 22:03 cbusillo

Yes. I used the GUI interface to select the track and export. I didn't go the command line route. I don't know the proper parameters. I can run some test commands if you want.

ddevler avatar Mar 25 '24 22:03 ddevler

I did some quick research. It seems like it retries until it gets the data or gives up. I counted 20 errors before it moved on in a logfile I found. I'm thinking of tracking the number of times a corrupt offset comes up in a row, if it hits 10 it will output a message to the console. I'm also thinking of a --continue-on-corrupt-error flag and by default halting on corrupt errors. What do you think about that?

cbusillo avatar Mar 25 '24 23:03 cbusillo

I think stopping it would be best. So there is no wasted processing time on bad output. If it hits an error just stop job and move to the next one in the batch. This way I can deal with the problem discs manually if necessary.

The flag would work for those that wish to keep the files. Incase it's just smaller issue that only covers tiny amount of time. where don't notice missing blocks.

ddevler avatar Mar 25 '24 23:03 ddevler

It looks like read retry can be specified. I guess the best way would be to set the read retry (maybe 10) and if it hits it, by default it stops and outputs. A --continue-on-corrupt-error flag would allow someone to encode anyway. Can you post the entire log for me, since I cannot reproduce your issue? Thanks. I'll post here when I have something working and uploaded for you to test. It might take a bit since I don't currently have a run_command_async function which I would need to watch the output while running.

cbusillo avatar Mar 25 '24 23:03 cbusillo

The disc is Frozen. Not that info will help reproduce it. The log is attached below. makemkv.txt

ddevler avatar Mar 25 '24 23:03 ddevler

Perhaps you should try thawing the disc before putting it in the reader?

Thank you for the log. I think I will look for a range in the corrupt line, that means it was not able to read and continued on and cannot read the x next sectors.

cbusillo avatar Mar 26 '24 00:03 cbusillo

The dvd movie is Frozen 3D.

As I mentioned earlier it couldn't read the blocks and continues on. You lose some scenes based on the number of sequential blocks that were skipped.

ddevler avatar Mar 26 '24 00:03 ddevler

My jokes are so good that no one gets them :)

My idea is look for a range of blocks, that means its falling to read. Thats where I will do the halt. If it doesn't give a range, it probably was able to read through retries.

cbusillo avatar Mar 26 '24 00:03 cbusillo

@ddevler the current version will pop up a message about the errors in MakeMKV and allow the user to continue.

cbusillo avatar Jun 12 '24 02:06 cbusillo