So the unexpected just happened. I was involved in an automobile accident this morning. Fortunately, nobody was hurt. I was driving in the left lane on a four lane road following another vehicle, when another driver decided to move from the right lane into my lane, but apparently misjudged as the rear wheel of their car clipped my front bumper, sending them into what I can only describe as a self-inflicted pit maneuver . In shock, I called 9-1-1 and checked to see if the other driver was okay. The police arrived, made the accident scene safe, did their investigation, and EMS made sure everybody was uninjured.

A screen grab from the formerly corrupt video file

When I got home, I wanted to see my dashcam footage to see if there was anything I could have done differently, as it is my goal to avoid accidents whenever possible. It also occurred to me that I could have been involved in some sort of accident scam that didn’t go as planned, so having a copy of the dashcam footage could be useful later on. There is also the possibility that the other driver could lie about what had happened; in which case, the video file would be able to prove who was at fault. I put the dashcam in my truck in 2018, and never touched it over the past 5 years. I soon came to realize that half of the videos stored on the MicroSD card did not work, and the time and date was wrong on the ones that did. As luck would have it, the video file containing the footage of the accident was one of the files that was corrupt. Each file had a file size, but something about the video file was corrupt or missing, so I could not watch it. I did some research using the regular search engines, and came across both downloadable software and online services that promised to repair damaged video files. The ones that appeared to work asked for a good video file from the same camera, but they only showed me a preview of the results. If I wanted to save a copy of the repaired video file, I would have to either pay for a “Premium” version of the software, or pay to download it from the web service. What I noticed during my investigation was that all of this software from different companies appeared to work in exactly the same way, and none of them were from any of the mainstream data recovery companies. Each one just seemed like a different interface to the same core. So I changed my search parameters; I focused on open source, and searched specifically for Linux solutions. That is how I came to discover the core program that was likely doing the actual work was an open source program named untruc which is licensed under the Gnu General Public License v2.0.

A screen grab from the formerly corrupt video file

What this program seems to do is it compares the broken video file with the good one, and then copies what it needs from the good video file to fix the broken one. If you’re running Windows, it’s very easy. Simply select either the 32 bit or 64 bit version under Assets. When installing, Windows will complain about installing software from unknown sources, but if you followed the links I provided here, you can see the source code for yourself and compile it. I didn’t bother to do this, as it’s a project that’s been on Github for a few years now, so I trust it and told Windows to go ahead and install it anyway. Then, when you run the program, it will ask for the broken video and the working video. It will spit out some error codes, but it should save the fixed video in the same directory as the other video files with “_fixed-dyn” appended to the filename. At least it did for me. I can’t guarantee this will work for you, but it’s certainly worth a shot. If you’re running Arch Linux like I do on my primary computer, you can find untruc here for your distro.

A screen grab from the formerly corrupt video file

I believe there is value in open source software, which is why, instead of paying a company that wrote a program or created a web service that may be using this open source software without giving any credit, I will be sending my money to the people who actually develop the open source code that makes all of our computers much more useful; in this case, it’s Alexander Steinkopp and Frederico Ponchio. I encourage everyone to support open source software developers if you can. Also, be sure to check your dashcam every once in a while. Once every five years probably isn’t a good idea.