Hello, I am new here, I am not sure if this is the right category but I hope so!
Anyways, I am new to programming, self taught and only in JavaScript and a little bit of Bash, so my skills are very basic. However, for reasons that I'm not gonna write multiple paragraphs about, I need to change the duration in an MKV file, and it needs to be quick. By duration I simply mean the metadata in the segment information and not changing the actual duration of the MKV movie. I can use FFMPEG and it will automatically set duration, but it's not fast enough (don't know how it works, but I don't wanna copy the entire file when all I need to do is change/add a few bytes).
I couldn't find any tools that allows me to do this, so I thought I would have to change it myself with a hex editor. I have an MKV file with a duration already set, I know how I can change the duration there, I've done it and it works. But I need to add a duration on an MKV file that's missing it, and I don't know where exactly in the hex editor it goes, and how I can add it, that's where I need help. I believe it needs to go in the "Segment Information", which has an EBML ID of "0x1549A966". But do I just add it in there right before any EBML ID in there?
For example, can I just add this in?Code:44 89 88 40 EB A5 00 00 00 00 00
It has a double value of 1556616, or the duration of the movie in MS. All I did was add it in right before 0x4D80 (MuxingApp EBML ID), simply hoping it would work and not really understanding all of it. Either way, it mostly didn't work.
Using MKVInfo on the file, it shows the duration, but then this error appears:
It doesn't show the duration of the movie in Windows either. In VLC media player, it loaded instantly, not sure if it has to do with me having played the movie right before adding the duration, or because I actually added the duration on it, but when there's not a duration set, it takes a while to start playing. But either way there's still an error in MKVInfo and it's not showing the duration in Windows, so I did something wrong. And would hope someone here can help me!Warning: test.mkv: Error in the Matroska file structure at position 280. Resyncing to the next level 1 element.
Warning: Resyncing successful at position 291.
Sorry if I added too much information, and if I added too little, tell me what more information I can come with!
It also
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 2 of 2
Thread
-
-
you may find this useful
Code:https://stackoverflow.com/questions/26687711/how-to-manually-change-duration-field-in-matroska-mkv
Similar Threads
-
how to find hex or brackpoint with hex editor o w32DMSN?
By marcorocchini in forum ProgrammingReplies: 0Last Post: 31st Dec 2021, 21:37 -
Repairing corrupted mov file with the hex editor
By dvdmaster1 in forum Newbie / General discussionsReplies: 14Last Post: 17th Feb 2019, 04:14 -
How long does it take for someone to create a Movie in a hex editor?
By lorenzo111 in forum Newbie / General discussionsReplies: 24Last Post: 8th Feb 2019, 11:51 -
Hex editor to recover damaged GoPro video files (Hero3)
By snooger in forum Video ConversionReplies: 24Last Post: 17th Nov 2018, 16:01 -
Erroneous file duration in mkv
By Travillion in forum Newbie / General discussionsReplies: 5Last Post: 23rd Sep 2018, 11:11