anthwlock / untrunc

Restore a truncated mp4/mov. Improved version of ponchio/untrunc
GNU General Public License v2.0
1.86k stars 181 forks source link

Canon R5 DAT (copputed MP4) file recovery Error: bad track: 'free' #170

Open aidolov23 opened 2 weeks ago

aidolov23 commented 2 weeks ago

I will try recovery DAT file from Canon R5 (this file recovering with problems from another software). Untruct show error "Error: bad track: 'free'"

Info: version '' using ffmpeg '3.3.9' Lavc57.89.100 Info: reading /mnt/IMG_3598.MP4 Info: parsing healthy moov atom ... Info: special track found (tmcd, '')

Info: unknown track 'twos' found -> fallback to dynamic stats Error: bad track: 'free'

Corrupted DAT file appears instead of MP4 if Canon R5 is turned off while shooting. I can send corrupted DAT and Good MP4 file if it needs.

anthwlock commented 2 weeks ago

Hey - please send me the files (healthy+broken) and I will take a look. You can upload them on wetransfer. If you think they are too big, you can use untrunc -sh file.mp4. In case you want to keep the link private, you can send me an email - see my Profile page. Thank you!

aidolov23 commented 2 weeks ago

I sent a link to the uploaded files by email

anthwlock commented 2 weeks ago

The healthy file has a predictable track order. However there is some additional padding between the packets (-> 'free' track), which currently confuses untrunc. Luckily for us, this padding also seems to follow a predictable pattern.

When I have the time, I will do some changes to better handles this.

vitos1k commented 2 weeks ago

uh, i got exactly the same situation. Canon R5 battery died and i left with DAT file. Untrunc says Error: bad track: 'free' is there any chance to save video? I can provide info on the file. However the file is huge 40+Gb i wouldn't be able to send it to you

anthwlock commented 1 week ago

is there any chance to save video?

Yes - it looks promising

anthwlock commented 6 days ago

Ok, I just committed a bunch of changes.

However there is some additional padding between the packets (-> 'free' track), which currently confuses untrunc.

Handling for this got added in 9e03db0e65f4a79490a68c4f2adfd57d0cd195c2

If the recovery ends prematurely, try to use '-s'.

vitos1k commented 6 days ago

it does work! Thanks! It Showed alot of warnings! And only worked with '-s' arg. But video is playing

aidolov23 commented 5 days ago

Thanks a lot. The file that I sent as an example was completely restored.

But I also checked my other older corrupted file (also canon r5 .dat), which I fully restored through another program with audio glitches - in latest Untrunc only the very beginning of the video is restored (I tried with "-s" and without). It looks like there is not yet a universal fix for Canon Dat files. But in any case, this is very useful, because there is no exact solution on the Internet on how to fix these canon .dat files, and I was able to recover only through a paid program. I also found advice to turn to paid services, where they ask for more than $60 for restoring 1 file.

I no longer need to restore files, but I can send other corrupted DAT and Good MP4 files that are not currently being restored, if necessary.

anthwlock commented 4 days ago

but I can send other corrupted DAT and Good MP4 files that are not currently being restored, if necessary

Sure, I might take a look at some point

aidolov23 commented 2 days ago

Sure, I might take a look at some point

Sent new link to the uploaded files by email