Strange corruption issue - MakeMKV's fault or bad HDD?

Please post here for issues related to DVD discs
pneumatic
Posts: 118
Joined: Sat Apr 01, 2023 8:09 am

Strange corruption issue - MakeMKV's fault or bad HDD?

Post by pneumatic » Sat Apr 01, 2023 9:02 am

Hello, I'm having a weird issue with corruption of the mkv's which MakeMKV is producing. It has happened about half a dozen times now, causing my entire media library to have a big question mark hanging over it whether the occasional mkv will be corrupt when it comes time to screening them.

I am not sure if MakeMKV is corrupting the output mkv file, or if the corruption is occurring internally within my HDD. I was leaning towards it being my HDD's fault, but then I did a full scan using SeaTools and it found no bad sectors.

When the glitch occurs, not only is the output mkv slightly corrupt and may freeze at certain points in the video, but in some cases the corrupt section may actually contain video and audio sequences from a completely different DVD disc which I had previously extracted with MakeMKV. For example I'll be playing Day of the Triffids, and then out of nowhere a scene from Curb Your Enthusiasm will appear for a few seconds. It is quite bizarre to see. The only thing in common was that both of these DVDs were extracted with MakeMKV. They were also written to possibly similar locations on the physical disc, so it could still be a HDD issue. If it was a MakeMKV bug, is it possible that some things from previously extracted DVD are still in memory without clearing them properly?

Additionally, if I get a corrupt mkv coming out of MakeMKV, I can run the process a second time and the resulting mkv is then good. I'm not sure what this implies.

I found I could test for corruption using ffmpeg:

Code: Select all

ffmpeg -v error -i "C:\MyVideo.mkv" -f null NUL
Ideally there should be no error messages, but in my experience many DVD's will produce some benign error messages, but the corrupted mkvs have different error messages and more of them so they are still identifiable from non corrupted mkvs.

Thanks.
Last edited by pneumatic on Wed Apr 05, 2023 12:19 am, edited 1 time in total.

Woodstock
Posts: 10332
Joined: Sun Jul 24, 2011 11:21 pm

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by Woodstock » Sat Apr 01, 2023 3:14 pm

MakeMKV keeps a check that what it writes is consistent with what's on the original disk, but it cannot deal with what is written getting corrupted.

A test would be to do multiple runs to different locations, i.e., have MakeMKV do the write twice, to different directories, and compare what is written. Other than some checksum information, two writes from the same source should be identical.

MakeMKV does not save information between disks, either, so having content that was from a previous decode within the output should not happen.

One possibility that just occurred to me - these aren't Lionsgate disks, are they? Those put multiple copies of the "main" (cough, cough) video out that have randomized sections included, as "copy protection". The last time I ripped something from them, there were a dozen "mostly the right size" versions of the movie, with randomized sections in places.

pneumatic
Posts: 118
Joined: Sat Apr 01, 2023 8:09 am

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by pneumatic » Sun Apr 02, 2023 12:44 am

Thanks, in that case it is probably not MakeMKV's fault.

Unfortunately I can't reproduce the issue as it just occurs randomly. For now I'm going to use a different HDD and then do the ffmpeg check on all output mkvs.

I did notice the checksums were never the same on any mkvs - I figured this must be due to some unique data like datestamps in the headers or something.

The discs are not Lionsgate, and I doubt that is the root cause as I can create the mkvs a second time and they come out good. Probably because they happened to be written to good sectors on the HDD whereas the previous time they got written to bad faulty sectors. Or maybe the physical sectors are fine and the controller's internal file map is getting corrupt. It is a 10 year old Seagate 1TB external USB 3.0 HDD. But it has hardly been used, only around 800GB written to it in its entire lifespan.

Woodstock
Posts: 10332
Joined: Sun Jul 24, 2011 11:21 pm

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by Woodstock » Sun Apr 02, 2023 2:40 am

Checksums always fail, because the files are written with the date/time they were created, plus the content. That's in the header of the file, pretty much.

Seagate? 1TB? Corruption is likely. I removed all Seagate drives in the .5-2TB range from our systems 5 years ago, because they were dying early. Our systems run 24/7, so drives never got a rest. A 10-year-old Seagate would scare me if it were a critical system.

pneumatic
Posts: 118
Joined: Sat Apr 01, 2023 8:09 am

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by pneumatic » Sun Oct 29, 2023 8:28 pm

So, I just had this issue again on a completely new USB drive (2TB Crucial MX500 SATA SSD connected via JMicron SATA to USB3.0 controller).

Use case scenario: I opened a DVD ISO file in MakeMKV (the ISO resides on the SSD) and extracted the mkv's to the same drive. i.e the source and destination drives are the same.

I got corrupted files many times, freezing during playback, and ffmpeg reports lots of errors in the mkv with eg. ffmpeg.exe -v error -i "k:\A1_t00.mkv" -f null NUL.

I then tried extracting the mkv's again but instead with the OS SATA SSD as the destination drive which is directly attached to motherboard and got no corruption multiple times.

Then I tried again extracting to the USB SSD and got corruption but on different files. Then I tried again and got no corruption, then corruption again.

I think it's some issue with USB maybe. Maybe some USB interference on the cable that causes data corruption when reading and writing simultaneously to the USB SSD. The USB SSD is the source and destination drive at high speed so maybe it's loading up the USB cable/interface in some edge case load scenario that's causing corruption. Or maybe a USB driver issue (Asrock Z97X).

Ezatoka
Posts: 409
Joined: Fri Dec 06, 2019 6:55 pm

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by Ezatoka » Sun Oct 29, 2023 10:54 pm

Out of curiousity: Where you running Google Chrome browser while doing so? I remember having a kinda similar problem with another program in the past.

While Chrome was open, I could not make a drive lock to the external device, causing the program to fail. I still don't know, why Chrome would even connect to USB drives.

Radiocomms237
Posts: 405
Joined: Mon Oct 18, 2021 12:23 am

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by Radiocomms237 » Sun Oct 29, 2023 11:52 pm

pneumatic wrote:
Sat Apr 01, 2023 9:02 am
~ I found I could test for corruption using ffmpeg:

Code: Select all

ffmpeg -v error -i "C:\MyVideo.mkv" -f null NUL
~
Is there a way to have that script in a Windows right-click menu?

As in, right-click on an .mkv file and choose "Verify using ffmpeg" (or something similar)?

I've been looking for something exactly like this for a while now (see this thread).

I've tried this on a number of files but it hasn't produced any errors whatsoever (I guess that's a good thing), so I've yet to see what an actual error looks like, but if it works this could save a lot of heartache.

d00zah
Posts: 1586
Joined: Mon Jun 06, 2016 8:23 pm

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by d00zah » Mon Oct 30, 2023 12:57 am

Radiocomms237 wrote:
Sun Oct 29, 2023 11:52 pm
Is there a way to have that script in a Windows right-click menu?
- create a shortcut to the script
- rename it "Verify using ffmpeg" (or something similar)
- place it in %UserProfile%\AppData\Roaming\Microsoft\Windows\SendTo

YMMV
Last edited by d00zah on Mon Oct 30, 2023 1:07 am, edited 1 time in total.

Radiocomms237
Posts: 405
Joined: Mon Oct 18, 2021 12:23 am

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by Radiocomms237 » Mon Oct 30, 2023 1:06 am

Thanks, now I just need to know how to write this "script"?!

I think it needs to be a "batch" file, but I don't know how to substitute the "C:\MyVideo.mkv" for the path and file that was right-clicked?

d00zah
Posts: 1586
Joined: Mon Jun 06, 2016 8:23 pm

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by d00zah » Mon Oct 30, 2023 1:10 am

Radiocomms237 wrote:
Mon Oct 30, 2023 1:06 am
Thanks, now I just need to know how to write this "script"?!

I think it needs to be a "batch" file, but I don't know how to substitute the "C:\MyVideo.mkv" for the path and file that was right-clicked?
Assuming the cmd in the OP does what you want, this should work (as a .bat)...

Code: Select all

@ECHO OFF

[full path to]\ffmpeg -v error -i "%1" -f null NUL
Last edited by d00zah on Mon Oct 30, 2023 1:28 am, edited 1 time in total.

Radiocomms237
Posts: 405
Joined: Mon Oct 18, 2021 12:23 am

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by Radiocomms237 » Mon Oct 30, 2023 1:18 am

Thanks!

I'll give that a go...

d00zah
Posts: 1586
Joined: Mon Jun 06, 2016 8:23 pm

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by d00zah » Mon Oct 30, 2023 1:23 am

Radiocomms237 wrote:
Mon Oct 30, 2023 1:18 am
Thanks!

I'll give that a go...
Upon reflection, that cmd will just run & exit. You'll either want to:

Code: Select all

@ECHO OFF

[full path to]\ffmpeg -v error -i "%1" -f null NUL

pause
so you can read the output, or direct the output to a log:

Code: Select all

@ECHO OFF

[full path to]\ffmpeg -v error -i "%1" -f >%1.txt
Last edited by d00zah on Mon Oct 30, 2023 1:31 am, edited 1 time in total.

Radiocomms237
Posts: 405
Joined: Mon Oct 18, 2021 12:23 am

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by Radiocomms237 » Mon Oct 30, 2023 1:30 am

Thanks, I was just typing a reply to say that the command prompt window flashes up and disappears again really quickly.

Added "pause" and now it remains on screen... so now I can read the error message!

It says:

Code: Select all

'[full' is not recognized as an internal or external command, operable program or batch file.
Press any key to continue...

d00zah
Posts: 1586
Joined: Mon Jun 06, 2016 8:23 pm

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by d00zah » Mon Oct 30, 2023 1:34 am

Radiocomms237 wrote:
Mon Oct 30, 2023 1:30 am
Thanks, I was just typing a reply to say that the command prompt window flashes up and disappears again really quickly.

Added "pause" and now it remains on screen... so now I can read the error message!

It says:

Code: Select all

'[full' is not recognized as an internal or external command, operable program or batch file.
Press any key to continue...
Don't use [full path to] literally. You'll need to provide the fully qualified path (wherever you put it) to ffmpeg.exe.

Radiocomms237
Posts: 405
Joined: Mon Oct 18, 2021 12:23 am

Re: Strange corruption issue - MakeMKV's fault or bad HDD?

Post by Radiocomms237 » Mon Oct 30, 2023 1:43 am

Thanks, I'm getting closer!

I now have this in my batch file:

Code: Select all

@ECHO OFF

C:\ffmpeg\bin\ffmpeg -v error -i "%1" -f null NUL

pause
But now ffmpeg is spitting out the error:

Code: Select all

[in#0 @ 00000000004eeac0] Error opening input: No such file or directory
Error opening input P:\TV.
Error opening input files: No such file or directory
EDIT: The actual file path I'm testing (just the first one I laid my hands on) is:

Code: Select all

P:\TV Shows - In Progress\~ According To Jim\Season 01\According To Jim - S01E01 - Pilot.mkv
So it seems to not like the [space] in the folder name for some reason?
Last edited by Radiocomms237 on Mon Oct 30, 2023 1:49 am, edited 1 time in total.

Post Reply