3
I have a set of binary file chunks from a video file. They are partly overlapping.
To exemplify say that the video file binary data can be represented like this:
---ABCDEFGHIJKLMNOPQRSTUVXYZ
where
---
is a header.
The chunks can be represented like this (simplified because there are some differences in the header part for each chunk):
chunk 1: "---ABCD"
chunk 2: "---DEFG"
chunk 3: "---GHIJ"
chunk 4: "---JKLM"
...
I need a command line tool that merges these files. It should take the end part of chunk 1, search chunk 2 for that pattern, join chunk 1 to the part of chunk 2 from pattern to end (ignoring all data in chunk 2 before the pattern start).
Then repeat the operation for all remaining chunks until we have the complete video file.
If your tool does the job, this is the best answer so far. I cannot audit your code and I'm not going to compile and test the tool in the nearest future just to check if it works. I don't expect anybody to. Nevertheless the whole thing seems legit and I'd like to reward you for your attitude. Some of my correct (I think) answers to niche questions are not upvoted nor downvoted, maybe because nobody bothered to test them. I upvote this answer because you share your work. Other users be aware my single upvote doesn't mean the tool has been tested. – Kamil Maciorowski – 2017-07-06T19:57:31.277