ponchio / untrunc

Restore a damaged (truncated) mp4, m4v, mov, 3gp video. Provided you have a similar not broken video.
GNU General Public License v2.0
1.62k stars 230 forks source link

Cannot restore footage with AAC-ELD stream #283

Open aldemoth opened 5 months ago

aldemoth commented 5 months ago

Hi.

I am trying to repair some videos recorded with Xiaomi Mi A2 but they contain AAC-ELD codec which is rarely used. Untrunc doesn't restore anything.

Untrunc output:

>  sudo ./untruncexe reference.mp4 truncated.mp4

Reading: reference.mp4
Repair: truncated.mp4
Mdat not found!
Could not guess length of best match

Trying a different approach to locate mdat start
Repair: truncated.mp4
Could not guess length of best match

Trying a different approach to locate mdat start
Repair: truncated.mp4
Mdat not found!
Could not guess length of best match

Trying a different approach to locate mdat start
Repair: truncated.mp4
Mdat not found!
Could not guess length of best match
Failed recovering the file
Saving to: truncated_fixed.mp4

I also tried untrunc-gui fork (https://github.com/anthwlock/untrunc). Enabling skip unknown parameter (-s) restores video when using that fork but it only restores keyframes correctly. Other frames are full of artifacts and it doesn't detect stream correctly. AAC-ELD stream is 20x larger than it should and hevc stream is 2 MB smaller than it should.

Untrunc-gui produces these warnings:

[aac @ 0000000000a22020] Number of scalefactor bands in group (41) exceeds limit (36). 
Warning: guessed frame durations of 'hvc1' will probably be wrong!
Warning: Unknown sequences: 5
Warning: Bytes NOT matched: 273KiB (1.804%)

I think main problem is AAC-ELD because both untrunc and untrunc-gui cannot restore videos properly, and untrunc-gui complains about aac scalefactor bands.

aldemoth commented 5 months ago

reference.zip truncated.zip truncated.mp4_fixed-s1.zip

truncated.mp4_fixed-s1.mp4 is untrunc-gui output.

ponchio commented 5 months ago

Could you send me a couple of samples? I will have a look at them.

On Thu, Apr 25, 2024 at 9:44 PM aldemoth @.***> wrote:

Uploading reference.zip… Uploading truncated.zip… Uploading truncated.mp4_fixed-s1.zip…

truncated.mp4_fixed-s1.mp4 is untrunc-gui output.

— Reply to this email directly, view it on GitHub https://github.com/ponchio/untrunc/issues/283#issuecomment-2078051429, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUDV25V4SI5NA26NNE2XELY7FMI3AVCNFSM6AAAAABGZP54POVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZYGA2TCNBSHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

aldemoth commented 5 months ago

Thanks. I edited this comment to fix broken links: https://github.com/ponchio/untrunc/issues/283#issuecomment-2078051429

reference.zip truncated.zip