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?
+ Reply to Thread
Results 1 to 12 of 12
-
-
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. -
The metadata in mp4's can be cleared in Windows Explorer, right click the file/properties/details
-
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. -
Its extremely difficult if not impossible. Download AtomicParsley and run command line :
AtomicParsley /path/to.mp4 -T 1
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] -
would this work ?? - https://auroraborealissoftware.jimdofree.com/english/introduction/
-
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.
-
-
AtomicParsley error: unsupported MPEG-4 file brand found 'isml'
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.
-
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. -
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. -
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?
Similar Threads
-
FFMPEG Conversion from MKV to MP4 returns a empty MP4 file?
By lolmaisine in forum Video ConversionReplies: 4Last Post: 6th Mar 2019, 07:45 -
Split mp4 file into specified size (part1.mp4, part2.mp4 etc.)
By TubeBar in forum EditingReplies: 7Last Post: 1st Feb 2019, 22:41 -
How to make exact copy of a mkv/mp4... add subtitles
By jagman911 in forum Video ConversionReplies: 2Last Post: 3rd Dec 2018, 12:29 -
Cut/Copy .mp4 video losslessly to .ts container
By Rajesh Singh in forum EditingReplies: 2Last Post: 30th Aug 2017, 14:18 -
converting vbr mp4 file to cbr mp4
By brandcc in forum Video ConversionReplies: 13Last Post: 19th Jun 2017, 08:43