anthwlock / untrunc

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

Multiple audio tracks causing failure #94

Open nickmoeck opened 3 years ago

nickmoeck commented 3 years ago

Hi,

Trying to recover a very large (~28GB) file generated by OBS with 4 audio tracks. Not sure how this affects things, but one of the audio tracks is a combination of the other 3 audio tracks. The issue seems to be similar to https://github.com/anthwlock/untrunc/issues/78

Info: version '3cf5947' using ffmpeg '3.3.4'
Info: reading V:\Warzone\Captures\2021-05-18 01-40-03.mp4
Info: parsing healthy moov atom ...
Composition time offset atom found. Out of order samples possible.

Warning: duplicate codecs found, but no (simple) track order found
Info: reading mdat from truncated file ...
Info: using 64-bit offsets for the broken file
[aac @ 00000000042d00a0] Multiple frames in a packet.
Error: unable to find correct codec -> premature end (~100%)
       try '-s' to skip unknown sequences

Info: Found 2655650 packets ( mp4a: 2289352 mp4a: 0 mp4a: 0 mp4a: 0 avc1: 366298 avc1-keyframes: 1466 )
Info: Duration of mp4a: 13h 33min 59s 509ms  (48839509 ms)
Info: Duration of mp4a:  (0 ms)
Info: Duration of mp4a:  (0 ms)
Info: Duration of mp4a:  (0 ms)
Info: Duration of avc1: 3h 23min 29s 933ms  (12209933 ms)
Info: pruned empty 'mp4a' track
Info: pruned empty 'mp4a' track
Info: pruned empty 'mp4a' track
Info: saving V:\Warzone\Captures\2021-05-17 22-12-23.mp4_fixed.mp4
written length: 31004556604

Truncated sample of the original file generated by untrunc -sh is available here: http://wz.nickmoeck.com/bad-short.mp4

Appreciate you taking a look, thanks!

anthwlock commented 2 years ago

Truncated files alone are not enough for me to help you / deduce the problem. Please also provide a working sample, thanks

kazzypoof commented 2 years ago

Having a similar Issue as well The split tracks seem to combine in a pattern,

Info: parsing healthy moov atom ... 

Warning: duplicate codecs found, but no (simple) track order found
Info: reading mdat from truncated file ...
Info: using 64-bit offsets for the broken file
[aac @ 00000000027a9200] Multiple frames in a packet.

Error: unable to find correct codec -> premature end (~100%)
       try '-s' to skip unknown sequences

Warning: guessed frame durations of 'mp4a' will probably be wrong!
Warning: guessed frame durations of 'avc1' will probably be wrong!
Info: Found 485093 packets ( mp4a: 367487 mp4a: 0 avc1: 117606 avc1-keyframes: 3922 )
Info: Duration of mp4a: 2h 10min 39s 722ms  (7839722 ms)
Info: Duration of mp4a:  (0 ms)
Info: Duration of avc1: 1h 5min 20s 405ms  (3920405 ms)
Info: pruned empty 'mp4a' track
Info: saving D:\Videos\ShadowPlay\VRChat\VRChat 2021.08.19 - 19.08.27.03.mp4_fixed.mp4
written length: 4933420637

1 warnings were hidden!

done!

I've included the reference, truncated, and resulting video files
https://drive.google.com/drive/folders/1O8jUXi83I5i1Iv1eSin56CjOiJg1pPxC?usp=sharing

vascojdb commented 2 years ago

Hi! I have the exact same issue while trying to recover a file from Streamlabs with 3 audio tracks (Mix+Game+Mic), even trying to run the tool on the sample (good) file gives the same result: 2 empty audio tracks + 1 audio track with 3x the length of the video (it seems the audio tracks are all interlaced in one single track). The good sample I am using can be found here: https://www.dropbox.com/s/qxyistge8bd1fed/video_sample.mp4?dl=1

Any help? I saw there were some changes made but I just took the repo today with docker and this is what I got.

JMS-1 commented 2 years ago

Very similiar problem here: large (25GB) OBS recording with three AAC audio tracks [game, comment, game+comment merged] broken by a computer freeze with reboot. In the fixed version generated by untrunc there is only one audio track with three times the duration of the video and somewhat mixed together - with heavy distortions.

ONMYBEAT commented 2 years ago

I use it all the time. Thank you. I arrived here with the exact same problem. Perhaps the environment is slightly different, but like everyone else, I had an unfortunate force close during OBS recording and the file was corrupted. And that the multitrack AAC is not restored when I try to restore it with untrunc.

I was told that the problem was solved with #78, but it seems to be multiple tracks strung together in one file. (Even as audio, it looks odd, as already mentioned.)

Has this issue been resolved yet? I am using Windows and would be happy to see a WindowsBuild. Thanks, for trying to fix the problem.

CHANOxDR commented 2 years ago

I have the same problem, it seems that here is the solution https://github.com/anthwlock/untrunc/issues/78, but I have no idea how to do it, can someone help me.

skyfpv commented 1 year ago

I'm having this same issue. Has anyone found a solution?

artenax commented 1 year ago

I use it all the time

Why would you use mp4 when there are more suitable containers? For example, ts or at least mkv.