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.59k stars 224 forks source link

untrunc on Ubuntu 16.04.2 LTS #76

Open jauling opened 7 years ago

jauling commented 7 years ago

Are there maybe some options I can pass to untrunc to get this to work right? Correct me if I'm wrong, but it looks like this output suggests that untrunc has some problems reading the 'ok' file?

jau@feeble:~$ untrunc-master/untrunc 2017_0126_161452_090.MP4 2015_0101_003210_091.MP4
Reading: 2017_0126_161452_090.MP4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2017_0126_161452_090.MP4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isomavc1mp42
    creation_time   : 2017-01-26 16:18:17
    original_format : NOVATEK
    original_format-eng: NOVATEK
    comment         : DEMO1
    comment-eng     : DEMO1
  Duration: 00:03:26.70, start: 0.000000, bitrate: 20273 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1440, 20071 kb/s, 30 fps, 30 tbr, 60k tbn, 60 tbc (default)
    Metadata:
      creation_time   : 2017-01-26 16:18:17
      handler_name    : DataHandler
      encoder         : h264
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 111 kb/s (default)
    Metadata:
      creation_time   : 2017-01-26 16:18:17
      handler_name    : DataHandler
avc1: no match because of nal type: 30
Success for no particular reason....
[aac @ 0x19992a0] Error decoding AAC frame header.

Invalid length. -50531338. Wrong match in track: 1
Found 0 packets
wolfied commented 7 years ago

i have exactly the same error, and it would seem you have the same camera as my, may i ask which one? i recently brought 2 elecam elite and so far most of the videos i have shot with them have been corrupted .. i did think it was my memory cards as they are unbranded and had problems saving at all till i formatted with minitool partition and been searching for a way to recover my videos.

jauling commented 7 years ago

Hi @wolfied sorry for the delayed response. I have a Gitup Git2 camera. I think maybe there is an onboard battery short, which I've heard happens sometimes. I've had the camera for a couple years now, and its only malfunctioned this one time.

I think my Samsung EVO microSD card is fine.

wolfied commented 7 years ago

I descovered the underlying prob for me was the cards themselves they were faked 32gb . And would only save the first file partial second then the rest just blank.. I brought 2 samsung evo+ and recorded a straight 3hrs on both cameras no problem. :)

chroeseler commented 6 years ago

Hi, @jauling did you had any more luck later? I got the same error and am still not sure were the problem started.

[...]
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55c79c4018a0] Non-increasing DTS in stream 3: packet 2521 with DTS 0, packet 2522 with DTS 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55c79c4018a0] Non-increasing DTS in stream 3: packet 2522 with DTS 0, packet 2523 with DTS 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'GOPR0091.MP4':
  Metadata:
    major_brand     : mp41
    minor_version   : 538120216
    compatible_brands: mp41
    creation_time   : 2018-04-07 16:52:13
  Duration: 00:00:23.61, start: 0.000000, bitrate: 30174 kb/s
    Stream #0:0(eng): Video: h264 (High) [avc1 / 0x31637661]
      yuvj420p, pc, bt709/bt709/bt709
      1280x720 [PAR 1:1 DAR 16:9], 30029 kb/s
      59.94 fps, 60k tbn (default)
    Metadata:
      creation_time   : 2018-04-07 16:52:13
      handler_name    :         GoPro AVC
      encoder         : GoPro AVC encoder
    Stream #0:1(eng): Audio: aac (LC) [mp4a / 0x6134706D]
      48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2018-04-07 16:52:13
      handler_name    :         GoPro AAC
    Stream #0:2(eng): Data: tmcd / 0x64636D74, 0 kb/s (default)
    Metadata:
      creation_time   : 2018-04-07 16:52:13
      handler_name    :         GoPro TCD
    Stream #0:3(eng): Data: fdsc / 0x63736466, 13 kb/s (default)
    Metadata:
      creation_time   : 2018-04-07 16:52:13
      handler_name    :         GoPro SOS
Track codec: mp4a
mp4a: Success because of large s value
[aac @ 0x55c79c4082a0] channel element 2.3 is not allocated
Duration: 0

Invalid length. -1052488119. Wrong match in track: 0
Track codec: avc1
avc1: failed for not particular reason
Track codec: 
Track codec: 
Found 0 packets
Track duration: 0 movie timescale: 60000 track timescale: 48000
Track duration: 0 movie timescale: 60000 track timescale: 60000
Track duration: 0 movie timescale: 60000 track timescale: 60000
Track duration: 0 movie timescale: 60000 track timescale: 60000'
ponchio commented 6 years ago

I think the problem are the data streams. (and lack of error reporting, sorry!).

To rebuild the index untrunc needs to determine start and length of all packets, and has no idea of what to do with the data.

It might be possible to discard those streams, with some modification, (and some luck). Could you send me a couple of samples (one at least working)?

Federico

On Mon, Apr 9, 2018 at 11:54 PM, Chris notifications@github.com wrote:

Hi, @jauling https://github.com/jauling did you had any more luck later? I got the same error and am still not sure were the problem started.

[...] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x55c79c4018a0] Non-increasing DTS in stream 3: packet 2521 with DTS 0, packet 2522 with DTS 0 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x55c79c4018a0] Non-increasing DTS in stream 3: packet 2522 with DTS 0, packet 2523 with DTS 0 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'GOPR0091.MP4': Metadata: major_brand : mp41 minor_version : 538120216 compatible_brands: mp41 creation_time : 2018-04-07 16:52:13 Duration: 00:00:23.61, start: 0.000000, bitrate: 30174 kb/s Stream #0:0(eng): Video: h264 (High) [avc1 / 0x31637661] yuvj420p, pc, bt709/bt709/bt709 1280x720 [PAR 1:1 DAR 16:9], 30029 kb/s 59.94 fps, 60k tbn (default) Metadata: creation_time : 2018-04-07 16:52:13 handler_name : GoPro AVC encoder : GoPro AVC encoder Stream #0:1(eng): Audio: aac (LC) [mp4a / 0x6134706D] 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: creation_time : 2018-04-07 16:52:13 handler_name : GoPro AAC Stream #0:2(eng): Data: tmcd / 0x64636D74, 0 kb/s (default) Metadata: creation_time : 2018-04-07 16:52:13 handler_name : GoPro TCD Stream #0:3(eng): Data: fdsc / 0x63736466, 13 kb/s (default) Metadata: creation_time : 2018-04-07 16:52:13 handler_name : GoPro SOS Track codec: mp4a mp4a: Success because of large s value [aac @ 0x55c79c4082a0] channel element 2.3 is not allocated Duration: 0

Invalid length. -1052488119. Wrong match in track: 0 Track codec: avc1 avc1: failed for not particular reason Track codec: Track codec: Found 0 packets Track duration: 0 movie timescale: 60000 track timescale: 48000 Track duration: 0 movie timescale: 60000 track timescale: 60000 Track duration: 0 movie timescale: 60000 track timescale: 60000 Track duration: 0 movie timescale: 60000 track timescale: 60000'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ponchio/untrunc/issues/76#issuecomment-379905890, or mute the thread https://github.com/notifications/unsubscribe-auth/ACg664t03k77WnMqtsJfv6NaioXcnjA_ks5tm9h6gaJpZM4MbhvG .

chroeseler commented 6 years ago

Can do. I will send them later this day. Luckily I have at least 3 of both, working and broken. Vg Chris

chroeseler commented 6 years ago

@ponchio Ok not quite the same day. ^^ I send you a mail. Hope it can help. Vg Chris