untrunc icon indicating copy to clipboard operation
untrunc copied to clipboard

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

Open aidolov23 opened this issue 1 year ago • 10 comments

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.

aidolov23 avatar Jun 16 '24 10:06 aidolov23

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!

anthwlock avatar Jun 16 '24 12:06 anthwlock

I sent a link to the uploaded files by email

aidolov23 avatar Jun 16 '24 13:06 aidolov23

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.

anthwlock avatar Jun 17 '24 16:06 anthwlock

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

vitos1k avatar Jun 18 '24 12:06 vitos1k

is there any chance to save video?

Yes - it looks promising

anthwlock avatar Jun 20 '24 19:06 anthwlock

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'.

anthwlock avatar Jun 26 '24 20:06 anthwlock

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

vitos1k avatar Jun 26 '24 23:06 vitos1k

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.

aidolov23 avatar Jun 27 '24 22:06 aidolov23

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

anthwlock avatar Jun 28 '24 18:06 anthwlock

Sure, I might take a look at some point

Sent new link to the uploaded files by email

aidolov23 avatar Jun 30 '24 17:06 aidolov23