repair mkv after hardware failure

mrlawrence

New Member
tl;dr Is there a way to recover most of this mkv? I read that I could try something with Avidemux or MKVToolNix, but I don't know how I'm supposed to use those (or ffmpeg for that matter) to repair my file because I'm a noob.


A couple hours into recording an mkv with obs my windows 10 machine's screen went black (well, the backlight stayed on), and after trying everything I could think of I held the power button to force a shutdown. After getting my computer back on again, I saw that the recording had indeed saved, but I can't open the file with anything, and I've tried a variety of things like:

I first tried to remux the recording with obs after noticing it wouldn't open in VLC, and after something on these forums suggested that. But it gave me this error: "Recording remuxed, but the file may be incomplete" and I couldn't find the mp4 file, so I checked to make sure that the output file name was set with an mp4 extension and it was, so then I tried:

this video (briefly flashed a command prompt but didn't seem to do anything)

this program (didn't seem to do anything)

This super basic ffmpeg command I read on a sketchy website (gave the error "[mov,mp4,m4a,3gp,3g2,mj2 @ 0000023da1b3a100] moov atom not found" for some reason):
ffmpeg.exe -i "2021-10-30 22-16-02.mkv" -c copy "2021-10-30 22-16-02_1.mkv"

and I also found this github page, but it seems like I'll have to jump through a few hoops to get it working, and in any case I read that mkvs don't have moov atoms, so I'm wondering if ffmpeg just misinterpreted the file type...since I do have other similar not broken videos like the github page says this program requires (I even have some from the same recording session, although this one I'm trying to repair is the main one/the longest by far - the others were just tests and then what I was able to record after turning my computer back on after the crash).

Actually now I'm more afraid that OBS overwrote the file and converted it into an mp4 (even though the extension is unchanged), even though in the remux settings I specified to save it as an mp4 file (albeit with the same name otherwise), because even though I thought I backed up the file before attempting to remux it, the file now says last modified around the time my computer crashed, but date created was around the time I did the remux. But it's the backup that I used for all the subsequent repair attempts (I think), like with ffmpeg, and the backup gives a date created of when I started recording and a date modified of around when my computer crashed. So I'm confused, since I should have definitely been feeding ffmpeg an mkv.

I think it's possible that I ran out of resources (although the drive I was saving too (not my C drive) had plenty of space) or maybe I had some kind of screen error, but I'm not sure. The first time I turned my computer back on after the crash, after logging in the screen went black/blank the way it had before, and so I restarted it again and after logging in when I got the same issue I just waited a few minutes and it eventually (albeit slowly) loaded everything - that's why I feel like explorer might've been involved. But I really have no idea.

My log file didn't seem to turn anything up btw. I'm attaching the newest log file from before the crash that I have, but it was from when I began recording, it looks like, and not from when my computer crashed, which was I guess 1.5-2 hours later. I have no crash reports.

Please help, or tell me how to prevent this in the future. Would using flv prevent this problem in the future? Can flv save both my computer's audio and my mic's audio?
 

Attachments

  • 2021-10-30 22-15-39.txt
    5.7 KB · Views: 30

mrlawrence

New Member
Okay now I'm confused. Checking my settings, under recording it says the container type is mp4...but then why does it always save as a .mkv??? If it's an mp4 is it unrecoverable?
 

Attachments

  • WDADesktopService_GJLSyfJpNZ.png
    WDADesktopService_GJLSyfJpNZ.png
    23.6 KB · Views: 74

koala

Active Member
With these ffmpeg output settings, a mp4 container is created, regardless of the file name or file extension. The error you got ("moov atom not found") also indicates you tried to process a mp4 container as input and not a mkv container. A mp4 file that not finalized is broken and cannot be recovered. You can delete the file. It's gone.

In the future, don't use advanced output mode with custom ffmpeg output. This is for the 0.1% of the people who need special esoteric customized settings. Instead, use simple output mode of OBS and record to an *.mkv file. That's the best setting for 99% of all people. If you need an *.mp4 file in the end, activate Settings->Advanced->Recording->"Automatically remux to mp4", so an automated convert is done whenever you finished a recording.
 

mrlawrence

New Member
I FIXED IT!!!!!!!!!!!!!!!!!

Since the github page I'd mentioned in the OP was only for fixing the moov problem, but I thought I had an mkv, I didn't try it at first, but since based on all this investigation I thought the file I'd ended up with actually IS an mp4, I decided to give the github program a shot.

I actually found a fork of the program that has a GUI and is usable on windows with no install: https://github.com/anthwlock/untrunc#GUI

Anyway, it must've only had to finish formatting the end of the video properly, because the result was exactly as expected with no apparent missing footage
 
Top