VideoHelp Forum
+ Reply to Thread
Results 1 to 12 of 12
Thread
  1. Hello,

    I've got two mp4 files with different headers and I would like to copy header (not sure if it's correct terminology - i mean copy all before real video stream) from one file to another.
    Is it possible with hex editor? I can see, that they are both similar, but with some differences (for example one has info of encoding software, second one doesn't) and I'm not sure how to do it properly. How to tell where header ends and real video data begins. Is it somehow fixed?

    Maybe there is some advanced editor that can do changes in headers and I don't have to use hex editor?
    Quote Quote  
  2. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    I doubt it... MP4 Header information contains, format,number of chunks, size of atoms, and many other as well as the usual aspect, Bitrate, audio strem, etc. all interconnected data specific to each MP4 and the location of each which may further reference other locations. It almost a certainty that that layout is the NOT same in each both.

    if you read:
    https://openmp4file.com/format.html#:~:text=MP4%20structures%20are%20typically%20refer...%204%20symbols.
    https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html

    You will see how interconnected and different each video may be.
    Quote Quote  
  3. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    The metadata in mp4's can be cleared in Windows Explorer, right click the file/properties/details
    Quote Quote  
  4. Thanks for reply. After closer looking at mp4 specification I can tell, that I don't have to replace whole header. In fact it's not good idea since it contains info of resolution, runtime etc.
    I need to replace few so called "atoms". How to do it safely? I mean how to tell when one atom ends and other begins by looking into files with hex editor?
    I was looking for some atoms editor but no luck.
    Quote Quote  
  5. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Its extremely difficult if not impossible. Download AtomicParsley and run command line :

    AtomicParsley /path/to.mp4 -T 1
    You will see how everything points to everything with hex bytes to point the way included in each atom. This is why the only Partially restore programs for MP4 are not free.

    FREE EXAMPLE:
    C:\Users\Bud\Desktop>AtomicParsley C:\Users\Bud\Desktop\xInstagram.mp4 -T 1
    Atom ftyp @ 0 of size: 32, ends @ 32
    Atom moov @ 32 of size: 730979, ends @ 731011
    Atom mvhd @ 40 of size: 108, ends @ 148
    Atom trak @ 148 of size: 321550, ends @ 321698
    Atom tkhd @ 156 of size: 92, ends @ 248
    Atom edts @ 248 of size: 36, ends @ 284
    Atom elst @ 256 of size: 28, ends @ 284
    Atom mdia @ 284 of size: 321414, ends @ 321698
    Atom mdhd @ 292 of size: 32, ends @ 324
    Atom hdlr @ 324 of size: 45, ends @ 369
    Atom minf @ 369 of size: 321329, ends @ 321698
    Atom vmhd @ 377 of size: 20, ends @ 397
    Atom dinf @ 397 of size: 36, ends @ 433
    Atom dref @ 405 of size: 28, ends @ 433
    Atom stbl @ 433 of size: 321265, ends @ 321698
    Atom stsd @ 441 of size: 153, ends @ 594
    Atom avc1 @ 457 of size: 137, ends @ 594
    Atom avcC @ 543 of size: 51, ends @ 594
    Atom stts @ 594 of size: 24, ends @ 618
    Atom stss @ 618 of size: 1452, ends @ 2070
    Atom ctts @ 2070 of size: 158496, ends @ 160566
    Atom stsc @ 160566 of size: 40, ends @ 160606
    Atom stsz @ 160606 of size: 80552, ends @ 241158
    Atom stco @ 241158 of size: 80540, ends @ 321698
    Atom trak @ 321698 of size: 407044, ends @ 728742
    Atom tkhd @ 321706 of size: 92, ends @ 321798
    Atom edts @ 321798 of size: 36, ends @ 321834
    Atom elst @ 321806 of size: 28, ends @ 321834
    Atom mdia @ 321834 of size: 406908, ends @ 728742
    Atom mdhd @ 321842 of size: 32, ends @ 321874
    Atom hdlr @ 321874 of size: 45, ends @ 321919
    Atom minf @ 321919 of size: 406823, ends @ 728742
    Atom smhd @ 321927 of size: 16, ends @ 321943
    Atom dinf @ 321943 of size: 36, ends @ 321979
    Atom dref @ 321951 of size: 28, ends @ 321979
    Atom stbl @ 321979 of size: 406763, ends @ 728742
    Atom stsd @ 321987 of size: 103, ends @ 322090
    Atom mp4a @ 322003 of size: 87, ends @ 322090
    Atom esds @ 322039 of size: 51, ends @ 322090
    Atom stts @ 322090 of size: 32, ends @ 322122
    Atom stsc @ 322122 of size: 210460, ends @ 532582
    Atom stsz @ 532582 of size: 115620, ends @ 648202
    Atom stco @ 648202 of size: 80540, ends @ 728742
    Atom udta @ 728742 of size: 2269, ends @ 731011
    Atom meta @ 728750 of size: 2261, ends @ 731011
    Atom hdlr @ 728762 of size: 34, ends @ 728796
    Atom ilst @ 728796 of size: 167, ends @ 728963
    Atom ctoo @ 728804 of size: 37, ends @ 728841
    Atom data @ 728812 of size: 29, ends @ 728841
    Atom ccmt @ 728841 of size: 87, ends @ 728928
    Atom data @ 728849 of size: 79, ends @ 728928
    Atom cnam @ 728928 of size: 35, ends @ 728963
    Atom data @ 728936 of size: 27, ends @ 728963
    Atom free @ 728963 of size: 2048, ends @ 731011
    Atom free @ 731011 of size: 8, ends @ 731019
    Atom mdat @ 731019 of size: 143637069, ends @ 144368088
    ------------------------------------------------------
    Total size: 144368088 bytes; 55 atoms total. AtomicParsley version: 0.9.0 (utf16
    )
    Media data: 143637069 bytes; 731019 bytes all other atoms (0.506% atom overhead)
    .
    Total free atom space: 2056 bytes; 0.001% waste. Padding available: 2056 bytes.
    ------------------------------------------------------
    Movie duration: 671.102 seconds (11:11.10) - 1712.25* kbp/sec bitrate (*=approxi
    mate)
    Low-level details. Total tracks: 2
    Trk Type Handler Kind Lang Bytes
    1 vide VideoHandler avc1 und 138267783
    1648.25* kbp/s 671.100 sec AVC Main Profile, Level 3 1152x648 (2880 macroblocks)
    2 soun SoundHandler mp4a und 5369278
    64.00 kbp/s 671.102 sec MPEG-4 AAC Low Complexity Profile channels: [2]
    Quote Quote  
  6. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by Baku86 View Post
    Thanks for reply. After closer looking at mp4 specification I can tell, that I don't have to replace whole header. In fact it's not good idea since it contains info of resolution, runtime etc.
    I need to replace few so called "atoms". How to do it safely? I mean how to tell when one atom ends and other begins by looking into files with hex editor?
    I was looking for some atoms editor but no luck.
    would this work ?? - https://auroraborealissoftware.jimdofree.com/english/introduction/
    Quote Quote  
  7. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    I doubt it. Your problem is probably not the extra atom. Commercial mp4 repair programs ask for a similar mp4 (as from the same camera or source) to copy its header to the bad and remove alter many specs to allow recovery. Some mp4s are only able to repair parts of them.
    Quote Quote  
  8. Deceased
    Join Date
    Dec 2007
    Search PM
    Originally Posted by Baku86 View Post
    I need to replace few so called "atoms".
    Need? But why? Are you able to elaborate?

    mp4edit (Bento4 package) may be able to do it, depending on exactly what "needs" to be done and how you go about it.
    Quote Quote  
  9. AtomicParsley error: unsupported MPEG-4 file brand found 'isml'

    Originally Posted by blimey View Post
    Need? But why? Are you able to elaborate?

    mp4edit (Bento4 package) may be able to do it, depending on exactly what "needs" to be done and how you go about it.
    I have one file with proper encryption atoms, and one file completely without it, but file is for 100% encrypted.
    Bento4 can't decrypt it when there is no encryption atom.
    So that's why I'm trying to copy those atoms from one file to another.
    Last edited by Baku86; 11th Mar 2021 at 03:25.
    Quote Quote  
  10. Deceased
    Join Date
    Dec 2007
    Search PM
    isml probably indicates that whatever file you're working on is from some streaming source.

    the "l" usually means it is from a "live" streaming source.

    unless isml is used in some other context.
    Quote Quote  
  11. Deceased
    Join Date
    Dec 2007
    Search PM
    Originally Posted by Baku86 View Post
    Bento4 can't decrypt it when there is no encryption atom.
    So that's why I'm trying to copy those atoms from one file to another.
    Bento4 has a different program that does decryption.

    mp4edit is the utility from the package that can insert/remove atoms.

    But you can't just insert any old spare atoms that you have lying around. You'd need to have obtained the specific atoms for the particular file. If you're dealing with an encrypted file, the relevant atoms would need to contain the init as well, which again, is file specific.

    See here.
    Quote Quote  
  12. I can obtain init file with bento4, but it doesn't have encryption info.
    I tried to manually add encv atom with hex editor (or copy it form init of properly tagged mp4) file, but to break next atoms like codec info, stream type etc.
    Probably it has to be inserted in exact byte.

    But if you say it's file specific, that approach is pointless.

    //Edit
    In topic you lik there is info, that init segment has to be merged with all other segments like 1:1 and not only ad the beginning of merged file. Is that rue?
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!