Creating STANAG 4609 stream from uncompressed frames.

In this article, we’ll show how to put together a simple application that encodes uncompressed frames (bitmaps) into H.264 video and inserts ASYNC Klv or SYNC Klv data into a transport stream. Let’s use KlvInjector SDK.

We’ll be dynamically generating the images for, but of course, you can get them from any source, like files or on the fly decoded streams…

First, we have to create a VS project, add the references and make sure all the required dependencies are copied to the target directory.

Next, we create an instance of the Klv Injector, initialize it and add events:
There are some additional parameters that may be configured:
Next, we’ll configure the output. In this demo we’ll have both network and file targets, so the resulted STANAG stream will be simultaneously recorded to file and sent to the network.
As we need to encode video, lets set the related parameters:
Next, configure the Klv part: 

Now, we just need to init and start the Injector and pump video frames accompanied with the Klv data

The injector is running now. We just need to send the images and the Klv metadata at the desired frame rate (like 30 fps).

  • frameBmp – bitmap. The bitmap can be created dynamically, as in the sample app or taken from the stream/file, after some pre-processing.
  •  timestamp – timestamp for video and SYNC KLV. Reference clock (100-nanosecond).
  • pcktBuf – RAW Klv buffer.

That’s it.  Let’s look at the results…  

More info on KlvInjector SDK.


No Comments

Post a Comment