Hey everyone,
I'm in a challenging situation with a corrupted-21.4GB\multiple MP4 video file(s), and this is actually a recurring problem for me. I could really use some advice on both recovering this file and preventing this issue in the future. Here's the situation:
- **The Incident:** My camera (Sony a7 III) unexpectedly shut down due to battery drain while recording a video. It had been recording for approximately 20-30 minutes.
- **File Details:**
- The resulting MP4 file is 21.4 GB in size, as reported by Windows.
- A healthy file from the same camera, same settings, and a similar duration (30 minutes) is also around 20 GB.
- When I open the corrupted file in a hex editor, approximately the first quarter contains data. But after that it's a long sequence of zeros.
- **Compression Test:** I tried compressing the 21.4 GB file. The resulting compressed file is only 1.45 GB. I have another corrupted file from a separate incident (also a Sony a7 III battery failure) that is 18.1 GB. When compressed, it shrinks down to 12.7 GB.
- **MP4 Structure:**
- Using a tool to inspect the MP4 boxes, I've found that the corrupted file is missing the `moov` atom (movie header). it has it but not all of it or maybe corrupted?
- It has an `ftyp` (file type) box, a `uuid` (user-defined metadata) box, and an `mdat` (media data) box. The `mdat` box is partially present.
- The corrupted file has eight occurrences of the text "moov" scattered throughout, whereas a healthy file from the same camera has many more(130). These are likely incomplete attempts by the camera to write the `moov` atom before it died.
- **What I've Tried (Extensive List):**
- I've tried numerous video repair tools, including specialized ones, but none have been able to fix the file or even recognize it.
- I can likely extract the first portion using a hex editor and FFmpeg.
- `untrunc`*:** This tool specifically designed for repairing truncated MP4/MOV files, recovered only about 1.2 minutes after a long processing time.
- **Important Note:** I've recovered another similar corrupted file using `untrunc` in the past, but that file exhibited some stuttering in editing software.
- **FFmpeg Attempt:** I tried using `ffmpeg` to repair the corrupted file by referencing the healthy file. The command appeared to succeed and created a new file, but the new file was simply an exact copy of the healthy reference file, not a repaired version of the corrupted file. Here's the commands I used:
```
ffmpeg -i "corrupted.mp4" -i "reference.mp4" -map 0 -map 1:a -c copy "output.mp4"
* [mov,mp4,m4a,3gp,3g2,mj2 @ 0000018fc82a77c0] moov atom not found
[in#0 @ 0000018fc824e080] Error opening input: Invalid data found when processing input
Error opening input file corrupted.mp4.
Error opening input files: Invalid data found when processing input]
ffmpeg -f concat -safe 0 -i reference.txt -c copy repaired.mp4
* [mov,mp4,m4a,3gp,3g2,mj2 @ 0000023917a24940] st: 0 edit list: 1 Missing key frame while searching for timestamp: 1001
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000023917a24940] st: 0 edit list 1 Cannot find an index entry before timestamp: 1001.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000023917a24940] Auto-inserting h264_mp4toannexb bitstream filter
[concat @ 0000023917a1a800] Could not find codec parameters for stream 2 (Unknown: none): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[aist#0:1/pcm_s16be @ 0000023917a2bcc0] Guessed Channel Layout: stereo
Input #0, concat, from 'reference.txt':
Duration: N/A, start: 0.000000, bitrate: 97423 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/arib-std-b67, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 95887 kb/s, 29.97 fps, 29.97 tbr, 30k tbn
Metadata:
creation_time : 2024-03-02T06:31:33.000000Z
handler_name : Video Media Handler
vendor_id : [0][0][0][0]
encoder : AVC Coding
Stream #0:1(und): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, stereo, s16, 1536 kb/s
Metadata:
creation_time : 2024-03-02T06:31:33.000000Z
handler_name : Sound Media Handler
vendor_id : [0][0][0][0]
Stream #0:2: Unknown: none
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Output #0, mp4, to 'repaired.mp4':
Metadata:
encoder : Lavf61.6.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/arib-std-b67, progressive), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 95887 kb/s, 29.97 fps, 29.97 tbr, 30k tbn
Metadata:
creation_time : 2024-03-02T06:31:33.000000Z
handler_name : Video Media Handler
vendor_id : [0][0][0][0]
encoder : AVC Coding
Stream #0:1(und): Audio: pcm_s16be (ipcm / 0x6D637069), 48000 Hz, stereo, s16, 1536 kb/s
Metadata:
creation_time : 2024-03-02T06:31:33.000000Z
handler_name : Sound Media Handler
vendor_id : [0][0][0][0]
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000023919b48d00] moov atom not foundrate=97423.8kbits/s speed=2.75x
[concat @ 0000023917a1a800] Impossible to open 'F:\Ep09\Dr.AzizTheGuestCam\Corrupted.MP4'
[in#0/concat @ 0000023917a1a540] Error during demuxing: Invalid data found when processing input
[out#0/mp4 @ 00000239179fdd00] video:21688480KiB audio:347410KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.011147%
frame=55530 fps= 82 q=-1.0 Lsize=22038346KiB time=00:30:52.81 bitrate=97439.8kbits/s speed=2.75x
Untrunc analyze
* 0:ftyp(28)
28:uuid(148)
176:mdat(23056088912)<--invalidlength
39575326:drmi(2571834061)<--invalidlength
55228345evc(985697276)<--invalidlength
68993972:devc(251968636)<--invalidlength
90592790:mean(4040971770)<--invalidlength
114142812:ctts(1061220881)<--invalidlength
132566741:avcp(2779720137)<--invalidlength
225447106tz2(574867640)<--invalidlength
272654889kip(2657341105)<--invalidlength
285303108:alac(3474901828)<--invalidlength
377561791ubs(3598836581)<--invalidlength
427353464:chap(2322845602)<--invalidlength
452152807:tmin(3439956571)<--invalidlength
491758484:dinf(1760677206)<--invalidlength
566016259:drmi(1893792058)<--invalidlength
588097258:mfhd(3925880677)<--invalidlength
589134677tsc(1334861112)<--invalidlength
616521034awb(442924418)<--invalidlength
651095252:cslg(2092933789)<--invalidlength
702368685ync(405995216)<--invalidlength
749739553tco(2631111187)<--invalidlength
827587619:rtng(49796471)<--invalidlength
830615425:uuid(144315165)
835886132:ilst(3826227091)<--invalidlength
869564533:mvhd(3421007411)<--invalidlength
887130352tsd(3622366377)<--invalidlength
921045363:elst(2779671353)<--invalidlength
943194122:dmax(4005550402)<--invalidlength
958080679tsz(3741307762)<--invalidlength
974651206:gnre(2939107778)<--invalidlength
1007046387:iinf(3647882974)<--invalidlength
1043020069:devc(816307868)<--invalidlength
1075510893:trun(1752976169)<--invalidlength
1099156795:alac(1742569925)<--invalidlength
1106652272:jpeg(3439319704)<--invalidlength
1107417964:mfhd(1538756873)<--invalidlength
1128739407:trex(610792063)<--invalidlength
1173617373:vmhd(2809227644)<--invalidlength
1199327317amr(257070757)<--invalidlength
1223984126:minf(1453635650)<--invalidlength
1225730123ubs(21191883)<--invalidlength
1226071922:gmhd(392925472)<--invalidlength
1274024443:m4ds(1389488607)<--invalidlength
1284829383:iviv(35224648)<--invalidlength
1299729513tsc(448525299)<--invalidlength
1306664001ml(1397514514)<--invalidlength
1316470096:dawp(1464185233)<--invalidlength
1323023782:mean(543894974)<--invalidlength
1379006466:elst(1716974254)<--invalidlength
1398928786:enct(4166663847)<--invalidlength
1423511184rpp(4082730887)<--invalidlength
1447460576:vmhd(2307493423)<--invalidlength
1468795885riv(1481525149)<--invalidlength
1490194207dp(3459093511)<--invalidlength
1539254593:hdlr(2010257153)<--invalidlength
```
- **A Common Problem:** Through extensive research, I've discovered that **this is a widespread issue**. Many people have experienced similar problems with cameras unexpectedly dying during recording, resulting in corrupted video files. While some have found success with tools like `untrunc`, `recover_mp4.exe`, or others that I've mentioned, these tools have not been helpful in my particular case!?!
- **Similar Case on GPAC/MP4Box Forum:** a relevant thread on the SourceForge GPAC/MP4Box forum where someone had a similar issue: https://sourceforge.net/p/gpac/discussion/287547/thread/20466c3e/.
- Tools that don't recognize the file include:
- [Recover-mp4](https://www.videohelp.com/software/recover-mp4-to-h264)
- **Shutter Encoder**
- **Handbrake**
- **VLC**
- **GPAC** When I try to open the corrupted file in GPAC, it reports "Bitstream not compliant."
- **My MP4Box GUI**
- **YAMB** When I try to open the corrupted file in YAMB, it reports "IsoMedia File is truncated."
- Many other common video repair tools.
Is there any possibility of recovering more than just the first portion of this particular 21.4 GB video? While a significant amount of data appears to be missing, could those fragmented "moov" occurrences be used to somehow reconstruct a partial `moov` atom, at least enough to make more of the `mdat` data (even if incomplete) accessible?
Any insights into advanced MP4 repair techniques, particularly regarding `moov` reconstruction?
Recommendations for tools (beyond the usual video repair software) that might be helpful in analyzing the MP4 structure at a low level?
Anyone with experience in hex editing or data recovery who might be able to offer guidance?
**Additional Information and Files I Can Provide:**
Corrupt file metadata from Mediainfo:
```
<?xml version="1.0" encoding="UTF-8"?>
<MediaInfo xmlns="https://mediaarea.net/mediainfo" xmlnssi="http://www.w3.org/2001/XMLSchema-instance" xsi
chemaLocation="https://mediaarea.net/mediainfo https://mediaarea.net/mediainfo/mediainfo_2_0.xsd" version="2.0">
<creatingLibrary version="24.11.1" url="https://mediaarea.net/MediaInfo">MediaInfoLib</creatingLibrary>
<media ref="Z:\Penjere\01Season\Production\Ep11\Dr.AzizTh eGuestCam\Corrupted.MP4">
<track type="General">
<FileExtension>MP4</FileExtension>
<Format>XAVC</Format>
<CodecID>XAVC</CodecID>
<CodecID_Compatible>XAVC/mp42/iso2</CodecID_Compatible>
<FileSize>23056715861</FileSize>
<StreamSize>23056715861</StreamSize>
<HeaderSize>176</HeaderSize>
<DataSize>23056088912</DataSize>
<FooterSize>626773</FooterSize>
<IsStreamable>No</IsStreamable>
<File_Created_Date>2025-01-23 06:05:54.544 UTC</File_Created_Date>
<File_Created_Date_Local>2025-01-23 09:05:54.544</File_Created_Date_Local>
<File_Modified_Date>2024-11-15 09:12:59.754 UTC</File_Modified_Date>
<File_Modified_Date_Local>2024-11-15 12:12:59.754</File_Modified_Date_Local>
</track>
</media>
</MediaInfo>
```
Metadata from camera itself (auto generated xml file):
```
<NonRealTimeMeta*xmlns="urnchemas-professionalDisc:nonRealTimeMeta:ver.2.00"*xmlns:l ib="urn
chemas-professionalDisc:lib:ver.2.00"*xmlns
si="http://www.w3.org/2001/XMLSchema-instance"*lastUpdate="2024-03-02T12:33:48+05:00">
<TargetMaterial*umidRef="060A2B340101010501010D431 3000000E8160286710306D2747A90FFFE064421"/>
<Duration*value="57810"/>
<LtcChangeTable*tcFps="30"*halfStep="false">
<LtcChange*frameCount="0"*value="63263704"*status= "increment"/>
<LtcChange*frameCount="57809"*value="60350905"*sta tus="end"/>
</LtcChangeTable>
<CreationDate*value="2024-03-02T12:33:48+05:00"/>
<VideoFormat>
<VideoRecPort*port="DIRECT"/>
<VideoFrame*videoCodec="AVC_3840_2160_HP@L51"*capt ureFps="29.97p"*formatFps="29.97p"/>
<VideoLayout*pixel="3840"*numOfVerticalLine="2160" *aspectRatio="16:9"/>
</VideoFormat>
<AudioFormat*numOfChannel="2">
<AudioRecPort*port="DIRECT"*audioCodec="LPCM16"*tr ackDst="CH1"/>
<AudioRecPort*port="DIRECT"*audioCodec="LPCM16"*tr ackDst="CH2"/>
</AudioFormat>
<Device*manufacturer="Sony"*modelName="ILCE-7RM4"*serialNo="4294967295"/>
<RecordingMode*type="normal"*cacheRec="false"/>
<AcquisitionRecord>
<Group*name="CameraUnitMetadataSet">
<Item*name="CaptureGammaEquation"*value="rec2100-hlg"/>
<Item*name="CaptureColorPrimaries"*value="rec709 "/>
<Item*name="CodingEquations"*value="rec709"/>
</Group>
</AcquisitionRecord>
</NonRealTimeMeta>
```
https://i.redd.it/h3vrh6zb1ree1.png
https://preview.redd.it/eight-moov-ghosts-in-a-21-4-gb-mp4-v0-fkux2so58ree1.png?width=2559&format=png&auto=webp& 3896513e
I know this is a complex issue, and I really appreciate anyone who takes the time to consider my problem and offer any guidance. Thank you in advance for your effort and for sharing your expertise. I'm grateful for any help this community can provide.
+ Reply to Thread
Results 1 to 3 of 3
-
-
Have you put the SDcard back into the camera to see if the camera can fix it?
See if there is anything useful here:
https://djifix.live555.com/ -
If your file compresses to 1.5GB, then you definitely won't recover anything from it (maybe a few minutes). You have to use a data recovery tool on the card (preferably after making a 1:1 copy of it to the image on the disk). Repairing a file downloaded from the camera is pointless.
Similar Threads
-
Can't get Untrunc-w mp4 Repair to Work
By Dart77 in forum Newbie / General discussionsReplies: 4Last Post: 8th May 2023, 19:03 -
mp4 repair untrunc GUI cant work properly/having problems
By DVDLover00 in forum Video ConversionReplies: 11Last Post: 5th Mar 2023, 01:40 -
[Sony Vegas] Best Render Settings for small mp4 videos
By Pepsi Twist in forum Newbie / General discussionsReplies: 4Last Post: 17th Dec 2021, 15:10 -
WTB: Dazzle DVCII (aka Snazzi* III)
By Methanoid in forum Capturing and VCRReplies: 6Last Post: 8th Jun 2021, 04:23 -
Sony a7s iii released!
By joejonas in forum Latest Video NewsReplies: 0Last Post: 28th Jul 2020, 07:11