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

GoPro Hero 5 - recovered videos are always smaller than original corrupted ones #118

Closed dmt0 closed 1 year ago

dmt0 commented 2 years ago

First of all thanks for the awesome app, it saves me from a lot of pain!

GoPro 5 seems to corrupt files each time the SD Card fills up (why would you test for that condition when you build a camera, right?? And that's with an SD Card that's listed as supported ).

When running continuously, it produces files of 3.63GB in size. After recovery they always come out to be 2.15GB, regardless of what I use as a sample. Is there anything I should do differently? Here's the output from my last recovery session - different things for different files from same session:

 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GOPR5236.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7fef95808800] Multiple frames in a packet.
[aac @ 0x7fef95808800] Reserved bit set.
[aac @ 0x7fef95808800] Number of bands (7) exceeds limit (6).
Error: unable to find correct codec -> premature end (~59.08%)
       try '-s' to skip unknown sequences

Info: Found 95869 packets ( gpmd: 285 fdsc: 47935 mp4a: 13394 avc1: 34255 avc1-keyframes: 286 )
Info: Duration of gpmd: 4min 45s 285ms  (285285 ms)
Info: Duration of mp4a: 4min 45s 738ms  (285738 ms)
Info: Duration of avc1: 4min 45s 743ms  (285743 ms)
Info: saving GOPR5236.MP4_fixed.MP4

 ~/Downloads/187GOPRO 
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GOPR5238.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7fde6c008800] Multiple frames in a packet.
[aac @ 0x7fde6c008800] Prediction is not allowed in AAC-LC.
Error: unable to find correct codec -> premature end (~59.08%)
       try '-s' to skip unknown sequences

Info: Found 95873 packets ( gpmd: 285 fdsc: 47937 mp4a: 13395 avc1: 34256 avc1-keyframes: 286 )
Info: Duration of gpmd: 4min 45s 285ms  (285285 ms)
Info: Duration of mp4a: 4min 45s 760ms  (285760 ms)
Info: Duration of avc1: 4min 45s 752ms  (285752 ms)
Info: saving GOPR5238.MP4_fixed.MP4
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GP015236.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7f7fb2019800] Multiple frames in a packet.
[aac @ 0x7f7fb2019800] Number of scalefactor bands in group (51) exceeds limit (49).
Error: unable to find correct codec -> premature end (~64.93%)
       try '-s' to skip unknown sequences

Info: Found 95869 packets ( gpmd: 285 fdsc: 47935 mp4a: 13394 avc1: 34255 avc1-keyframes: 286 )
Info: Duration of gpmd: 4min 45s 285ms  (285285 ms)
Info: Duration of mp4a: 4min 45s 738ms  (285738 ms)
Info: Duration of avc1: 4min 45s 743ms  (285743 ms)
Info: saving GP015236.MP4_fixed.MP4
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GP015238.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7fddc580a800] Multiple frames in a packet.
[aac @ 0x7fddc580a800] Reserved bit set.
[aac @ 0x7fddc580a800] invalid band type
Error: unable to find correct codec -> premature end (~59.08%)
       try '-s' to skip unknown sequences

Info: Found 95873 packets ( gpmd: 285 fdsc: 47937 mp4a: 13394 avc1: 34257 avc1-keyframes: 286 )
Info: Duration of gpmd: 4min 45s 285ms  (285285 ms)
Info: Duration of mp4a: 4min 45s 738ms  (285738 ms)
Info: Duration of avc1: 4min 45s 760ms  (285760 ms)
Info: saving GP015238.MP4_fixed.MP4
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GP025238.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7ff9e6812200] Multiple frames in a packet.
[aac @ 0x7ff9e6812200] Number of bands (42) exceeds limit (31).
Error: unable to find correct codec -> premature end (~59.08%)
       try '-s' to skip unknown sequences

Info: Found 95865 packets ( gpmd: 285 fdsc: 47933 mp4a: 13393 avc1: 34254 avc1-keyframes: 286 )
Info: Duration of gpmd: 4min 45s 285ms  (285285 ms)
Info: Duration of mp4a: 4min 45s 717ms  (285717 ms)
Info: Duration of avc1: 4min 45s 735ms  (285735 ms)
Info: saving GP025238.MP4_fixed.MP4
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GP045238.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7fc10680d600] Multiple frames in a packet.
[aac @ 0x7fc10680d600] SSR is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x7fc10680d600] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Error: unable to find correct codec -> premature end (~59.2%)
       try '-s' to skip unknown sequences

Info: Found 96053 packets ( gpmd: 286 fdsc: 48027 mp4a: 13419 avc1: 34321 avc1-keyframes: 287 )
Info: Duration of gpmd: 4min 46s 286ms  (286286 ms)
Info: Duration of mp4a: 4min 46s 272ms  (286272 ms)
Info: Duration of avc1: 4min 46s 294ms  (286294 ms)
Info: saving GP045238.MP4_fixed.MP4
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GP035238.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7fad11808c00] Multiple frames in a packet.
[aac @ 0x7fad11808c00] Reserved bit set.
[aac @ 0x7fad11808c00] SSR is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x7fad11808c00] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Error: unable to find correct codec -> premature end (~59.08%)
       try '-s' to skip unknown sequences

Info: Found 95873 packets ( gpmd: 285 fdsc: 47937 mp4a: 13395 avc1: 34256 avc1-keyframes: 286 )
Info: Duration of gpmd: 4min 45s 285ms  (285285 ms)
Info: Duration of mp4a: 4min 45s 760ms  (285760 ms)
Info: Duration of avc1: 4min 45s 752ms  (285752 ms)
Info: saving GP035238.MP4_fixed.MP4
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GP055238.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7fc9ae808c00] Multiple frames in a packet.
Warning: Codec::was_bad_ = 1
[aac @ 0x7fc9ae808c00] channel element 3.0 is not allocated
Error: unable to find correct codec -> premature end (~59.2%)
       try '-s' to skip unknown sequences

Info: Found 96054 packets ( gpmd: 286 fdsc: 48027 mp4a: 13420 avc1: 34321 avc1-keyframes: 287 )
Info: Duration of gpmd: 4min 46s 286ms  (286286 ms)
Info: Duration of mp4a: 4min 46s 293ms  (286293 ms)
Info: Duration of avc1: 4min 46s 294ms  (286294 ms)
Info: saving GP055238.MP4_fixed.MP4
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GP065238.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7fe8b4025000] Multiple frames in a packet.
[aac @ 0x7fe8b4025000] channel element 3.15 is not allocated
Error: unable to find correct codec -> premature end (~59.09%)
       try '-s' to skip unknown sequences

Info: Found 95885 packets ( gpmd: 285 fdsc: 47943 mp4a: 13396 avc1: 34261 avc1-keyframes: 286 )
Info: Duration of gpmd: 4min 45s 285ms  (285285 ms)
Info: Duration of mp4a: 4min 45s 781ms  (285781 ms)
Info: Duration of avc1: 4min 45s 793ms  (285793 ms)
Info: saving GP065238.MP4_fixed.MP4
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GP075238.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7f975980be00] Multiple frames in a packet.
[aac @ 0x7f975980be00] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x7f975980be00] Too large remapped id is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x7f975980be00] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
Error: unable to find correct codec -> premature end (~59.08%)
       try '-s' to skip unknown sequences

Info: Found 95867 packets ( gpmd: 285 fdsc: 47934 mp4a: 13394 avc1: 34254 avc1-keyframes: 286 )
Info: Duration of gpmd: 4min 45s 285ms  (285285 ms)
Info: Duration of mp4a: 4min 45s 738ms  (285738 ms)
Info: Duration of avc1: 4min 45s 735ms  (285735 ms)
Info: saving GP075238.MP4_fixed.MP4
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GP085238.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7fdcd200be00] Multiple frames in a packet.
[aac @ 0x7fdcd200be00] channel element 3.10 is not allocated
Error: unable to find correct codec -> premature end (~59.2%)
       try '-s' to skip unknown sequences

Info: Found 96053 packets ( gpmd: 286 fdsc: 48027 mp4a: 13419 avc1: 34321 avc1-keyframes: 287 )
Info: Duration of gpmd: 4min 46s 286ms  (286286 ms)
Info: Duration of mp4a: 4min 46s 272ms  (286272 ms)
Info: Duration of avc1: 4min 46s 294ms  (286294 ms)
Info: saving GP085238.MP4_fixed.MP4
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GP095238.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7faa1e032800] Multiple frames in a packet.
[aac @ 0x7faa1e032800] Reserved bit set.
[aac @ 0x7faa1e032800] invalid band type
Error: unable to find correct codec -> premature end (~59.08%)
       try '-s' to skip unknown sequences

Info: Found 95863 packets ( gpmd: 285 fdsc: 47932 mp4a: 13393 avc1: 34253 avc1-keyframes: 286 )
Info: Duration of gpmd: 4min 45s 285ms  (285285 ms)
Info: Duration of mp4a: 4min 45s 717ms  (285717 ms)
Info: Duration of avc1: 4min 45s 727ms  (285727 ms)
Info: saving GP095238.MP4_fixed.MP4
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GP105238.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7fd1f400e200] Multiple frames in a packet.
[aac @ 0x7fd1f400e200] channel element 2.4 is not allocated
Error: unable to find correct codec -> premature end (~59.08%)
       try '-s' to skip unknown sequences

Info: Found 95869 packets ( gpmd: 285 fdsc: 47935 mp4a: 13394 avc1: 34255 avc1-keyframes: 286 )
Info: Duration of gpmd: 4min 45s 285ms  (285285 ms)
Info: Duration of mp4a: 4min 45s 738ms  (285738 ms)
Info: Duration of avc1: 4min 45s 743ms  (285743 ms)
Info: saving GP105238.MP4_fixed.MP4
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GP115238.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7fe341010800] Multiple frames in a packet.
[aac @ 0x7fe341010800] channel element 2.8 is not allocated
Error: unable to find correct codec -> premature end (~59.08%)
       try '-s' to skip unknown sequences

Info: Found 95867 packets ( gpmd: 285 fdsc: 47934 mp4a: 13394 avc1: 34254 avc1-keyframes: 286 )
Info: Duration of gpmd: 4min 45s 285ms  (285285 ms)
Info: Duration of mp4a: 4min 45s 738ms  (285738 ms)
Info: Duration of avc1: 4min 45s 735ms  (285735 ms)
Info: saving GP115238.MP4_fixed.MP4
 ~/Downloads/187GOPRO  ~/work/untrunc/untrunc GOPR5235.MP4 GP125238.MP4
Info: version 'v308-d72ec32' using ffmpeg 'd72ec32'
Info: reading GOPR5235.MP4
Info: parsing healthy moov atom ...
Info: special track found (meta, 'GoPro MET')
Info: special track found (meta, 'GoPro SOS')

Info: reading mdat from truncated file ...
[aac @ 0x7fab58808800] Multiple frames in a packet.
[aac @ 0x7fab58808800] Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x7fab58808800] Inconsistent channel configuration.
[aac @ 0x7fab58808800] get_buffer() failed
Error: unable to find correct codec -> premature end (~99.86%)
       try '-s' to skip unknown sequences

Info: Found 96235 packets ( gpmd: 286 fdsc: 48118 mp4a: 13445 avc1: 34386 avc1-keyframes: 287 )
Info: Duration of gpmd: 4min 46s 286ms  (286286 ms)
Info: Duration of mp4a: 4min 46s 826ms  (286826 ms)
Info: Duration of avc1: 4min 46s 836ms  (286836 ms)
Info: saving GP125238.MP4_fixed.MP4
zhubinsheng commented 1 year ago

any help?

dmt0 commented 1 year ago

I just sold the cam and vowed to never buy a GoPro again :)