Today, while recording a video for a client, the fake battery ran out of power, causing the camera to shut down abruptly and the video file to be unsaved. I didn’t realize this immediately because my impression of the FX3 was that it would save the video file even if the power was forcibly cut off during recording. It wasn’t until I got home and opened the memory card that I was shocked: the first video file was missing!
I immediately started searching for various methods to recover the file and also sought help from Taobao. However, the price quoted on Taobao was 600 RMB, and recovery wasn’t guaranteed. Come on, I barely make any money; if I give you 600 RMB, what’s left for me?
File Recovery
First, I needed to recover the file. Since I used a Sony FX3
and a Sony CFA
card, my initial reaction was to search for these two keywords and found the most reliable and free official recovery software: Memory Card File Rescue. By entering the corresponding information for your memory card, it helps you download the appropriate recovery software. It’s really considerate, haha. After about an 8-minute scan, I recovered the file, which was a 12.68GB DAT
file.
I searched many websites and found no software that could directly convert a DAT
file to MP4
or something similar. Some blogs claimed that vlc
could do it, but in reality, it couldn’t. So, I began extensive searches again. If you’ve seen a Bilibili UP master’s self-written recovery script, I can tell you that the recovered video is garbled in the upper part. I also tried using ffmpeg
to process it, but that was also ineffective.
Handling the DAT File
The difference between the recovered DAT
file and a normal MP4
file is mainly the absence of the moov
data chunk. The mdat
records the frame information in the video, and the moov
stores the format for reading the video frame information. Because the machine shut down suddenly, there wasn’t enough time to write the moov
data chunk, so the core task was to recover the moov
data chunk.
Since my second video (which I started recording immediately after replacing the battery) had the same recording specifications as the first, the moov
from the first video could be replicated from the second video. Of course, if you don’t have another video to replicate from, you can record a few seconds of video with the same specifications as the DAT
file.
The great
open-source tool untrunc helped me solve the problem of recovering the moov
data chunk. If you’re a Windows user, you can read untrunc Chinese to learn how to use it.
Restoring to Original
By using untrunc, I successfully recovered the 12.68GB DAT
file to a 12.68GB MP4
. What moved me even more was that the recovered video retained its original bitrate, frame rate, and resolution, restoring the picture to its original quality!