anthwlock / untrunc

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

File from Insta360 Pro2 partial restore issue #88

Closed ehcheng closed 2 years ago

ehcheng commented 3 years ago

THANK YOU for making this version of the tool available. I'm sure it's been a lifesaver for many people.

We have a corrupted clip from an Insta360 Pro2, along with a working video from the same camera. Attempting to untrunc results in only a partial recovery. The verbose logs suggested using "-s" to skip unknown sequences. When I use "-dyn -s", I get a larger file, but the video is the same length.

The end of the log shows this: log.zip

Any tips? Thanks again!

(reading element from mdat) Offset: 4013064191 / 4013068287 : c1ff1200 81b8c667 Track codec: mp4a Track codec: avc1 Track codec: camm called getChunkPrediction(4013064191 / 4013068287) ... stepToNextOwnChunkOff(4013064191): to: mp4a last chunk_off: 3969625424 next: 4013064192 stepToNextOwnChunkOff(4013064191): to: avc1 last chunk_off: 3969625417 next: 4013064192 stepToNextOwnChunkOff(4013064191): to: camm last chunk_off: 718937380 next: 4013064192 Warning: only found decode times partially!Warning: guessed frame durations of 'camm' will probably be wrong! Info: Found 4923 packets ( mp4a: 2658 avc1: 1700 avc1-keyframes: 59 camm: 565 ) Info: Duration of mp4a: 56s 704ms (56704 ms) Info: Duration of avc1: 56s 723ms (56723 ms) Info: Duration of camm: 56s 2ms (56002 ms) Warning: Unknown sequences: 17 Warning: Bytes NOT matched: 324MiB (8.464%) Info: saving 3d.mp4_fixed-s1-dyn.mp4 skipping 5004445 at 720262178 / 720266274 skipping 3287725 at 725266624 / 725270720 skipping 87787070 at 728554349 / 728558445 skipping 504810680 at 816341419 / 816345515 skipping 5503410 at 1321152099 / 1321156195 skipping 9593401 at 1326655509 / 1326659605 skipping 22098995 at 1336248911 / 1336253007 skipping 1992645859 at 1358347906 / 1358352002 skipping 22666019 at 3350993765 / 3350997861 skipping 58985898 at 3373659784 / 3373663880 skipping 223063469 at 3432645682 / 3432649778 skipping 19478237 at 3655709151 / 3655713247 skipping 4599349 at 3675187396 / 3675191492 skipping 24790462 at 3679786745 / 3679790841 skipping 232632409 at 3704577207 / 3704581303 skipping 24626903 at 3937209616 / 3937213712 skipping 7334242 at 3961836519 / 3961840615 skipping 225272 at 3969170769 / 3969174865 skipping 229368 at 3969396049 / 3969400145 skipping 23739379 at 3969625425 / 3969629521 skipping 19699388 at 3993364804 / 3993368900

anthwlock commented 3 years ago

At Offset: 720262178 / 720266274 : c8000600 98c18093 the detection fails. It looks like the camm track again, so I wonder why the transition-based detection fails (Maybe avc1_camm transitions are rare, and thus the pattern is not fine tuned enough).

The resulting file is contiguous, right?

If you send me a sample of both files (healthy + broken) I will try to add some improvements. Using untrunc -sh you can extract the first 200mb, which should be enough.

ehcheng commented 3 years ago

Thank you! The broken file is contiguous. I'll send to you now via WeTransfer.

anthwlock commented 3 years ago

I would appreciate it if you could send me more of the broken file, let's say 1GB. Again you can use untrunc for this extraction: untrunc -sh broken.mp4 1000. If you have another healthy sample, that would be useful too.

I pushed a commit to the camm branch, which adds a hardcoded pattern + size (for the 'camm' track). The problem is that I doubt that this will generalize well, so I'd like to see if the chunk-based method can be improved.

ehcheng commented 3 years ago

Thank you. I just sent both a 1GB broken file fragment, and a 2nd working sample.

ehcheng commented 3 years ago

Anthon, do you happen to have a Windows build handy? My Mac is indisposed at the moment, and I don't have a well functioning Linux environment set up. Thank you!

On Fri, Apr 9, 2021 at 8:01 AM Anthon Lockwood @.***> wrote:

I would appreciate it if you could send me more of the broken file, let's say 1GB. Again you can use untrunc for this extraction: untrunc -sh broken.mp4 1000. If you have another healthy sample, that would be useful too.

I pushed a commit to the camm https://github.com/anthwlock/untrunc/tree/camm branch, which adds a hardcoded pattern + size (for the 'camm' track). The problem is that I doubt that this will generalize well, so I'd like to see if the chunk-based method can be improved.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anthwlock/untrunc/issues/88#issuecomment-816746150, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEWR2KZD4ZYMD35UJZGVXDTH4JF5ANCNFSM42PDMU5A .

anthwlock commented 2 years ago

I merged the camm branch, so appropriate windows builds are now available at releases