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

ALAC codec not working #138

Open piotrpaweladamczyk opened 1 year ago

piotrpaweladamczyk commented 1 year ago

Hi

I have one old and unique family recording, made on iPhone 3G using Voice Memo app with ALAC encoding. It contains about an hour of audio, but at the very end battery died and phone shut down leaving the recording corrupted (missing MOOV Atom). I tried to recover it with untrunc, but when analyzng other recordings made on the same day, I discovered the software has an issue with analizying it properly.

Example output with analyze(-a) option:

Info: parsing healthy moov atom ... 

Track 0 codec: alac

(0) Size: 3797 offset: 0 / 44  begin: 00000000 00131008 end: 2166a5c000000000
detected size: 4294967295 true: 3797  <- WRONG

(1) Size: 3437 offset: 3797 / 3841  begin: 00000000 00131007 end: 33b3ac7000000000
detected size: 4294967295 true: 3437  <- WRONG

(2) Size: 3810 offset: 7234 / 7278  begin: 00000000 00131006 end: 4dc94c7800000000
detected size: 4294967295 true: 3810  <- WRONG

(3) Size: 4387 offset: 11044 / 11088  begin: 00000000 00131005 end: 8c2e5dc000000000
detected size: 4294967295 true: 4387  <- WRONG

[...]

Detected size is always WRONG, on any file played back properly in VLC. I'm wondering if there is a chance to add support for ALAC or fix the problem somehow, as I've been searching for a solution for over 9 years now and successful attempts with the more common AAC codec have given me a lot of hope.