untrunc
untrunc copied to clipboard
Failed to parse atoms in truncated file
Hi, I am getting an error of "failed to parse atoms in truncated file".
The files are here: https://1drv.ms/u/s!AiQBClagXLxTm_ktym3xv8hrPVBcng?e=cIHP8t
I am running in powershell and with this command: docker run -v ${pwd}:/vol -it synctree/untrunc /vol/working.m4a /vol/broken.m4a This starts running but gives an error. I adjusted per the instructions in the readme, but I got the same result
Output is:
Reading: /vol/working.m4a Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/vol/working.m4a': Metadata: major_brand : M4A minor_version : 0 compatible_brands: M4A mp42isom creation_time : 2022-07-16 08:54:04 Duration: 01:18:08.06, start: 0.000000, bitrate: 24 kb/s Stream #0.0(eng): Audio: aac, 16000 Hz, mono, s16, 24 kb/s Metadata: creation_time : 2022-07-16 08:54:04 Failed to parse atoms in truncated file
There is a similar issue but no resolution so I am reposting to see if this gets more attention.
Following the comment re copy the header using a hex editor, I looked at the file and found there is no mdat or moov element to the damaged file. The 3rd line in the file was different but replacing this didn't change the result. I tried the first 20 rows but still untrunc give that same result.
Hi, the mdat starting point is not really the problem: untrunc first looks for the mdat string, and if missing will try to start from the same byte index, (in your case the start of the mdat is the same).
The problem is related to how the audio packets are split and what the audio codec expects int term of packet lenght. It's a bit complicated. I hope to find a solution, luckily the source code is available, even if not properly documented..
Hi, do I understand that you are going to try to fix the audio for me & help me understand what I might be able to do if this happens again?
I am trying to solve the problem, which is improve packet boundary detection, if I have success untrunc would fix the video without any additional steps.