I'm in the process of writing an image analysis pipeline and I've hit a bit of a roadblock. Here's the 30,000-ft view:
- Images arrive as base64-encoded PNG images over standard input
- Images are decoded, and processed. I don't think the details are particularly relevant, but I am happy to offer specifics in the form of an edit.
- When the analysis is complete, the entire stream must be concatenated into a seekable, timestamped format (that is, a video file of some sort) and saved to disk.
My question pertains to stage 3
. At this final stage of the pipeline, each frame will have a set of associated features that were extracted via the image analysis performed in stage 2
. I would like for the final output format (the video format) to preserve this information alongside the frame that "owns" it. In other words, one should think about this as a separate channel that evolves alongside the video data, locked to the same time reference. This would notably allow me to treat features as time-series.
Here's a simple diagram to further illustrate what I'm trying to achieve.
-0 ms--16 ms--32 ms--48 ms--64 ms- ... n ms -> # time channel
-F1----F2-----F3-----F4-----F5---- ... Fn ---> # video channel
-1.1---3.6----5.0----2.6----3.1--- ... 11.2 -> # data channel 1
-100---105----120----96-----101--- ... 52 ---> # data channel 2
As you can see in the above schema, there are two data channels (although, ideally, the format should support an arbitrary number of channels) whose values evolve over time. Note that the time
channel need not be an actual channel, per se, but was illustrated as such simply to show that video and data channels are represented as a function of time.
At the very least I'd like to be able to populate each "index" of each channel with an int or a float. Ideally, however, I would like to be able to hold a reference to some binary data of arbitrary length.
In addition to providing the above functionality, this hypothetical codec should support some form of modern video compression. Does such a thing exist?