anthwlock / untrunc

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

Fixed mp4 highly truncated #5

Closed MontyJ closed 6 years ago

MontyJ commented 6 years ago

anthwlock,

Per your comments over on poncio/untrunc, I was able to get a successful compile with no errors. However, when I run it on the good and bad mp4 files, it heavily truncates the new file and appears to show only the first frame of the bad video.

The original mp4 is 109Mb, the fix file is 428Kb. I have several 'good' mp4 files taken with the same camera, but the result is the same no matter which one I choose as the good file.

Here is the result of the run that shows the errors:


$ ./untrunc /home/monty/'Yuneec Q500 Drone/Videos'/YUN00003.mp4 /home/monty/'Yuneec Q500 Drone/Videos'/YUN00005.mp4
Info: reading /home/monty/Yuneec Q500 Drone/Videos/YUN00003.mp4
Info: parsing healthy moov atom ... 
Composition time offset atom found. Out of order samples possible.
Info: avcC got decoded
Info: parsing mdat from truncated file ... 
Error: New access unit since seen picture (type: 12)
Error: Invalid length: -22. Wrong match in track: 0
Error: unable to find correct codec -> premature end
Info: Found 3 packets ( mp4a: 1 avc1: 2 avc1-keyframes: 1 )
Info: Duration of mp4a = 1.024s
Info: Duration of avc1 = 6.006s
Info: saving /home/monty/Yuneec Q500 Drone/Videos/YUN00005.mp4_fixed.mp4

Is this bad file a lost cause?

Thanks for your help!

Monty

anthwlock commented 6 years ago

Hi, I need the files in order to test it.

MontyJ commented 6 years ago

anthwlock,

I am unable to upload the two .mp4 files. System says "We don't support that file type". Another email addy I can send them to? 9Mb and 109Mb files.

Monty

anthwlock commented 6 years ago

upload here: filebin.net or here: send.firefox.com

MontyJ commented 6 years ago

Ok, uploaded to the send firefox site. I sent the download links to you at your tuta.io email.

MontyJ commented 6 years ago

Sorry, clicked the wrong button...didn't mean to close the thread!

anthwlock commented 6 years ago

So I checked the files you provided me, and untrunc seems to work mostly fine on those. I changed the handling of NAL_FILLER_DATA. Please try if it works better now. Is it normal for your 100mb files to be only 30 seconds long?

anthwlock commented 6 years ago

This problem stems form libavcodec and only occurs on some versions of libavcodec. The relevant error message is this: [aac @ 0x55e1b0a01360] Got unexpected packet size after a partial decode. To anyone with more information, feel free to reopen this issue.