allonlinux / AMRT

AMRT is Another Media Recovery Tool, developed to recover videos deleted or lost from a GoPro camera.
10 stars 0 forks source link

GoPro Hero 4 #1

Open brianmaxon opened 9 years ago

brianmaxon commented 9 years ago

Do you have any suggestions for modifying the code to support the GoPro Hero 4 (Silver) file format? I've included an excerpt from the header of a working file.

Adding the header pattern to AMRT.java allows the program to detect the presence of the video files, but the format of the header appears to be different so it fails to pass the checks in the VideoDecoder.readHeader method.

in AMRT.java

        g__headers[1]=new MediaDescriptor(MediaTypeEnum.Video,  MediaCodecEnum.MP4_mp41,        "\\x00\\x00\\x00\\x14\\x66\\x74\\x79\\x70\\x6D\\x70\\x34\\x31\\x20\\x13\\x10\\x18");

Example of GoPro Hero 4 (Silver) header

Offset(h) 00       04       08       0C
00000000  00000014 66747970 6D703431 20131018  ....ftypmp41 ...
00000010  6D703431 0851801F 6D646174 4750524F  mp41.Q€.mdatGPRO
00000020  08010000 4844342E 30312E30 312E3032  ....HD4.01.01.02
00000030  2E30304C 41543430 39323130 30313038  .00LAT4092100108
00000040  35363600 00000000 00000000 00000000  566.............
00000050  00000000 00000000 00000000 00000000  ................
00000060  0000000B DEC56A89 36F88F1C 89402984  ....ÞÅj‰6ø..‰@)„
00000070  FFB79F48 45524F34 2053696C 76657200  ÿ·ŸHERO4 Silver.
00000080  00000000 00000000 00000000 00000000  ................
00000090  00000000 00000000 A0410000 0BDEC56A  ........ A...ÞÅj
000000A0  8936F88F 1C894029 84FFB79F CDC4DE07  ‰6ø..‰@)„ÿ·ŸÍÄÞ.
000000B0  12090000 00006EC2 00000000 00000000  ......nÂ........
000000C0  01000000 60EA0000 80070000 38040000  ....`ê..€...8...
000000D0  00000000 80070000 38040000 01000000  ....€...8.......
000000E0  80BB0000 64000000 10000000 02000000  €»..d...........
000000F0  00F40100 C8299454 C8299454 00000000  .ô..È)”TÈ)”T....
00000100  00000000 00000000 00000000 00000000  ................
00000110  00000000 00000000 00000000 00000000  ................
00000120  00000000 47500301 000AA6C7 000003E9  ....GP....¦Ç...é
00000130  00000000 00000038 2764002A AC34C807  .......8'd.*¬4È.
00000140  80227E5C 05B80808 0A000007 D20003A9  €"~\.¸......Ò..©
00000150  81D0C000 E4E00000 E4E1D779 71A18001  .ÐÀ.äà..äá×yq¡€.
00000160  C9C00001 C9C3AEF2 E1F08845 16000000  ÉÀ..ÉîòáðˆE....
00000170  01000000 00000000 00000004 28EE3830  ............(î80
00000180  00000001 00000000 00000000 00000000  ................
00000190  00000000 00000000 00000000 00000000  ................
000001A0  00000000 00000000 00000000 00000000  ................
000001B0  00000000 00000000 00000000 00000002  ................
000001C0  09100000 00200600 0D8099D0 0015F900  ..... ...€™Ð..ù.
000001D0  99D00015 F9400109 00000824 68000003  ™Ð..ù@.....$h...
000001E0  00010601 C480000A A69925B8 0100008F  ....Ä€..¦™%¸....
000001F0  C5834D76 D51D0798 EE49D3C5 137D91A2  ŃMvÕ..˜îIÓÅ.}‘¢
00000200  FB15922F 1671FFB2 958B72FD 4BCA58E4  û.’/.qÿ²•‹rýKÊXä
00000210  59B78740 C740D5CC A4E4D74D 4FE77A7C  Y·‡@Ç@Õ̤ä×MOçz|
00000220  500EDB1F E074E3DC CD48FE8F 5C6DD26D  P.Û.àtãÜÍHþ.\mÒm
00000230  D6F83C17 D5DED688 51521B12 AEBD204E  Öø<.ÕÞÖˆQR..®½ N
00000240  CAB37897 DF541D77 58556FD5 64A31DB2  ʳx—ßT.wXUoÕd£.²
00000250  3E9BFC80 1094B804 00CF75B8 A1042148  >›ü€.”¸..Ïu¸¡.!H
00000260  97962F7E 7AA143A0 0777BB19 46B64922  —–/~z¡C .w».F¶I"
00000270  9429FEFA 642008DC 71D6E319 50A0311C  ”)þúd .ÜqÖã.P 1.
00000280  821A59F5 78C665B2 C4A7B99F 30FAAC2B  ‚.YõxÆe²Ä§¹Ÿ0ú¬+
00000290  8FFAC23A 549091A1 377420F0 01DD624C  .úÂ:T.‘¡7t ð.ÝbL
allonlinux commented 9 years ago

Hi, If you send me the log file (with your modified version), I might be able to give you some more information. Regards, Pierre

On 01/21/2015 05:51 AM, brianmaxon wrote:

Do you have any suggestions for modifying the code to support the GoPro Hero 4 (Silver) file format? I've included an excerpt from the header of a working file.

Adding the header pattern to |AMRT.java| allows the program to detect the presence of the video files, but the format of the header appears to be different so it fails to pass the checks in the |VideoDecoder.readHeader| method.

  in AMRT.java
g__headers[1]=new MediaDescriptor(MediaTypeEnum.Video, MediaCodecEnum.MP4_mp41, "\x00\x00\x00\x14\x66\x74\x79\x70\x6D\x70\x34\x31\x20\x13\x10\x18");
Example of GoPro Hero 4 (Silver) header
Offset(h) 00 04 08 0C 00000000 00000014 66747970 6D703431 20131018 ....ftypmp41 ... 00000010 6D703431 0851801F 6D646174 4750524F mp41.Q€.mdatGPRO 00000020 08010000 4844342E 30312E30 312E3032 ....HD4.01.01.02 00000030 2E30304C 41543430 39323130 30313038 .00LAT4092100108 00000040 35363600 00000000 00000000 00000000 566............. 00000050 00000000 00000000 00000000 00000000 ................ 00000060 0000000B DEC56A89 36F88F1C 89402984 ....ÞÅj‰6ø..‰@)„ 00000070 FFB79F48 45524F34 2053696C 76657200 ÿ·ŸHERO4 Silver. 00000080 00000000 00000000 00000000 00000000 ................ 00000090 00000000 00000000 A0410000 0BDEC56A ........ A...ÞÅj 000000A0 8936F88F 1C894029 84FFB79F CDC4DE07 ‰6ø..‰@)„ÿ·ŸÍÄÞ. 000000B0 12090000 00006EC2 00000000 00000000 ......nÂ........ 000000C0 01000000 60EA0000 80070000 38040000 ....`ê..€...8... 000000D0 00000000 80070000 38040000 01000000 ....€...8....... 000000E0 80BB0000 64000000 10000000 02000000 €»..d........... 000000F0 00F40100 C8299454 C8299454 00000000 .ô..È)”TÈ)”T.... 00000100 00000000 00000000 00000000 00000000 ................ 00000110 00000000 00000000 00000000 00000000 ................ 00000120 00000000 47500301 000AA6C7 000003E9 ....GP....¦Ç...é 00000130 00000000 00000038 2764002A AC34C807 .......8'd.*¬4È. 00000140 80227E5C 05B80808 0A000007 D20003A9 €"~.¸......Ò..© 00000150 81D0C000 E4E00000 E4E1D779 71A18001 .ÐÀ.äà..äá×yq¡€. 00000160 C9C00001 C9C3AEF2 E1F08845 16000000 ÉÀ..ÉîòáðˆE.... 00000170 01000000 00000000 00000004 28EE3830 ............(î80 00000180 00000001 00000000 00000000 00000000 ................ 00000190 00000000 00000000 00000000 00000000 ................ 000001A0 00000000 00000000 00000000 00000000 ................ 000001B0 00000000 00000000 00000000 00000002 ................ 000001C0 09100000 00200600 0D8099D0 0015F900 ..... ...€™Ð..ù. 000001D0 99D00015 F9400109 00000824 68000003 ™Ð..ù@.....$h... 000001E0 00010601 C480000A A69925B8 0100008F ....Ä€..¦™%¸.... 000001F0 C5834D76 D51D0798 EE49D3C5 137D91A2 ŃMvÕ..˜îIÓÅ.}‘¢ 00000200 FB15922F 1671FFB2 958B72FD 4BCA58E4 û.’/.qÿ²•‹rýKÊXä 00000210 59B78740 C740D5CC A4E4D74D 4FE77A7C Y·‡@Ç@Õ̤ä×MOçz 00000220 500EDB1F E074E3DC CD48FE8F 5C6DD26D P.Û.àtãÜÍHþ.\mÒm 00000230 D6F83C17 D5DED688 51521B12 AEBD204E Öø<.ÕÞÖˆQR..®½ N 00000240 CAB37897 DF541D77 58556FD5 64A31DB2 ʳx—ßT.wXUoÕd£.² 00000250 3E9BFC80 1094B804 00CF75B8 A1042148 >›ü€.”¸..Ïu¸¡.!H 00000260 97962F7E 7AA143A0 0777BB19 46B64922 —–/~z¡C .w».F¶I" 00000270 9429FEFA 642008DC 71D6E319 50A0311C ”)þúd .ÜqÖã.P 1. 00000280 821A59F5 78C665B2 C4A7B99F 30FAAC2B ‚.YõxÆe²Ä§¹Ÿ0ú¬+ 00000290 8FFAC23A 549091A1 377420F0 01DD624C .úÂ:T.‘¡7t ð.ÝbL

— Reply to this email directly or view it on GitHub https://github.com/allonlinux/AMRT/issues/1.

brianmaxon commented 9 years ago

Is this the log information you mean?

##### Recover video with Protune 'OFF' (THM/MP4/LRV) #####

THM @ 0x494e8000
MP4 @ 0x494f0000
LRV @ 0x4a670000

Warning : The header size should be a factor of the cluster size : 134283304
java.io.IOException: Failed to read the header : not valid
    at fr.free.allonlinux.amrt.media.video.VideoDecoder.readHeader(VideoDecoder.java:94)
    at fr.free.allonlinux.amrt.media.video.VideoDecoder.recover(VideoDecoder.java:350)
    at fr.free.allonlinux.amrt.gui.ResultPanel$ProcessingThread.run(ResultPanel.java:138)
Media not handled yet... 'MP4_mp41'
Media not handled yet... 'MP4_mp41'

##### Recover video with Protune 'OFF' (THM/MP4/LRV) #####

THM @ 0x4fdf8000
MP4 @ 0x4fe00000
LRV @ 0x50f80000

Warning : The header size should be a factor of the cluster size : 134283304
java.io.IOException: Failed to read the header : not valid
    at fr.free.allonlinux.amrt.media.video.VideoDecoder.readHeader(VideoDecoder.java:94)
    at fr.free.allonlinux.amrt.media.video.VideoDecoder.recover(VideoDecoder.java:350)
    at fr.free.allonlinux.amrt.gui.ResultPanel$ProcessingThread.run(ResultPanel.java:138)
Media not handled yet... 'MP4_mp41'
Media not handled yet... 'MP4_mp41'
allonlinux commented 9 years ago

Yes it is !

Obviously, the header format is not the same than the one on GoPro Hero3 cameras... Can you send me (through a FTP or any cloud website) the data between 0x494e8000 and 0x4B7F0000 (around 36MB) so I can investigate and figure out what is the header structure ?

On 01/21/2015 03:30 PM, brianmaxon wrote:

Is this the log information you mean?

|##### Recover video with Protune 'OFF' (THM/MP4/LRV) #####

THM @ 0x494e8000 MP4 @ 0x494f0000 LRV @ 0x4a670000

Warning : The header size should be a factor of the cluster size : 134283304 java.io.IOException: Failed to read the header : not valid at fr.free.allonlinux.amrt.media.video.VideoDecoder.readHeader(VideoDecoder.java:94) at fr.free.allonlinux.amrt.media.video.VideoDecoder.recover(VideoDecoder.java:350) at fr.free.allonlinux.amrt.gui.ResultPanel$ProcessingThread.run(ResultPanel.java:138) Media not handled yet... 'MP4_mp41' Media not handled yet... 'MP4_mp41'

Recover video with Protune 'OFF' (THM/MP4/LRV)

THM @ 0x4fdf8000 MP4 @ 0x4fe00000 LRV @ 0x50f80000

Warning : The header size should be a factor of the cluster size : 134283304 java.io.IOException: Failed to read the header : not valid at fr.free.allonlinux.amrt.media.video.VideoDecoder.readHeader(VideoDecoder.java:94) at fr.free.allonlinux.amrt.media.video.VideoDecoder.recover(VideoDecoder.java:350) at fr.free.allonlinux.amrt.gui.ResultPanel$ProcessingThread.run(ResultPanel.java:138) Media not handled yet... 'MP4_mp41' Media not handled yet... 'MP4_mp41' |

— Reply to this email directly or view it on GitHub https://github.com/allonlinux/AMRT/issues/1#issuecomment-70846293.

brianmaxon commented 9 years ago

Thanks for your help!

Here is the link to the file with the data from between those hex addresses:

https://www.dropbox.com/s/prf3hyl809dn7h5/goprohero4-fromsdcard.img?dl=0

3v1n0 commented 9 years ago

Any news on this?

I'm trying to recover my GoPro4 videos, but it looks like they're corrupted when trying with some other software...

Looking around I've found this about the Hero 4 format:

The Hero 4 range is similar to the Hero 3 above except the order of the atoms is different. On the Hero 4 the ftyp is immediately followed by the mdat. At the end of the recording, the moov atom is added. As in Hero 3 high and low resolution streams are interleaved give the same recovery issues.

mgualt commented 9 years ago

I am also trying to use your software to reconstitute videos from a recovered Gopro4 silver. Please let me know if you have ideas for including this model. Many thanks

fullmetalpacket commented 7 years ago

Any update on GoPro 4 support?

Thanks

leodom commented 4 years ago

I wish I could find a similar script for Hero 5...

dmgl commented 3 years ago

Find a recovery method for GoPro Hero 7 White