Monday, June 1, 2015

windows - Command line merge a sequence of overlapping binary file chunks in Win or Linux

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.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...