• No results found

KLV encoder / decoder library for STANAG 4609

N/A
N/A
Protected

Academic year: 2021

Share "KLV encoder / decoder library for STANAG 4609"

Copied!
10
0
0

Loading.... (view fulltext now)

Full text

(1)

KLV (Key-Length-Value) is a data encoding standard used for binary data byte-packing and metadata embedding into video feeds. KLV encoder/decoder C++ library (available for both Windows and Linux) allows seamless integration at the encoding/streaming side, while KLV decoder module  (available also as  Direct Show KLV decoder filter or C# module ) may be used at the client side for data extraction. When used with optional

MISB 0601 converter module

, KLV decoder translates received data according to the EG0601 standard and provides a list of parsed and converted KLV items with corresponding timing information.

KLV (Key-Length-Value) is a byte-level data encoding

standard used for binary data byte-packing and metadata

embedding into video feeds. Data is encoded into the 

K

ey-L

ength-V

alue triplets, where

K

(2)

L

ength specifies the data's length, and

V

alue is the data itself. It is defined in SMPTE 336M-2007

(Data Encoding Protocol Using Key-Length Value),

approved by the 

Society of Motion Picture and Television Engineers

. A KLV encoding protocol defines a data structure which

is independent of the application or transportation method

used.

The KLV encoder C++ library (A .Net wrapper is available upon request) allows seamless integration at the encoding/streaming side, while KLV decoder module  ( available also as 

Direct Show KLV decoder filter or

C# module

) may be used on the client side for extraction of encoded data. When used with optional MISB 0601 converter module

, KLV decoder translates received data according to the MISB 0601.X standard and provides a list of parsed and converted KLV items with corresponding timing information.

{xtypo_alert}KLV lib and STANAG4609Lib have been specially designed to deal with STANAG 4609 standard and contain numerous helper functions and converters to

facilitate  LDS and UDS metadata sets creation, Big Endian swap, etc. {/xty po_alert}

{xtypo_sticky} "ITAR-free" {/xtypo_sticky}

(3)

The MPEG-2 Transport Stream provides an infrastructure for the carriage of video, audio and metadata in a single motion imagery stream as shown below.

(4)

STANAG 4609

STANAG 4609 is intended to provide common methods for exchange of motion imagery across systems within and among NATO nations. It provides a guidance on uncompressed,

compressed, and related motion imagery sampling structures; motion imagery time standards, motion imagery metadata standards, interconnections, and common language descriptions of motion imagery system parameters.

Unmanned Air Systems use two types of KLV encoded metadata. Universal Data Set (UDS) -the 16-byte key, basic encoding rules (BER) formatted  length, and -the data value is appropriate for applications where bandwidth isn't a concern. However, transmitting the 16-byte universal key  quickly uses up the available bandwidth. UAS airborne platforms use a wireless

communications channel where the bandwidth for metadata is limited.  Because of the

bandwidth disadvantages of using a Universal Data Set, it is more desirable to use a Local Data Set for transmission over a UAS Datalink.  Local Data Set can use a 1, 2 or 4-byte key with a 1, 2, 4-byte, or BER encoded length.  For more info about KLV use in UAS application see ref pageUseInUAV

Used in both military and civil applications, the KLV lib allows developers to create  applications that receive streaming video coming from UAV platforms, extract the telemetry and other

metadata (KLV format, for example EG 0601.X) process it in real time or archive for later retrieval. KlvLib supports processing of Compound items (sets, packs).

(5)

uilt on top of KLV Lib {/xtypo_alert}

KLV encoded metadata in MPEG Transport streams .

Read more on how video and KLV encoded metadata can be synchronously transported in MPEG Transport streams according to STANAG 4609.

KLVLib makes it easy to encode or decode the KLV data.

Below is the hypothetical example MMS data packets (ISB Standards 0601.2, 0102.5, and SMPTE 336M-2007), as described in EG0902.

{xtypo_warning} All values are shown for illustration purposes only!{/xtypo_warning}

(6)

The TLV bytes are appended end-to-end, and together become the value portion of the

enclosing KLV packet. In this example, there are 97 bytes of TLV data - this is encoded as the length of the KLV packet. The whole local set starts with the 16 byte UL key, followed by the length 0x61, followed by all the TLV hex bytes above in order. In hex, the whole example KLV packet is:

(7)

{xtypo_warning} All metadata shall be represented using big-endian encoding, i.e. the most significant byte (MSB) is first. Bytes shall be big-endian bit  encoding – with the most significant bit (msb) first. {/xtypo_warning}

You can easily analyze low level KLV data using KlvInspector tool. Here is a screencapture of the MISB EG0909 sample data imported into KlvInspector

(8)

Below is a sequence diagram for encoding the above Metadata using KLVLib

(9)

Sequence diagram that describes decoding of Metadata using KLVLib

(10)

To encode/decode the above sample MMS data packets the following simple code may be used:

First, create and initialize an instance of KLV Encoder: {codecitation class=")" width=""}

// 1. Create STANAG 4609 KLV encoder

IKlvEncoder* klvEncoder = CreateKlvEncoder();

// 2. Set outer key. We use ASCII string for this example

klvEncoder->SetOuterKey("060E2B34020B01010E01030101000000"); // 3. Set checksum key

klvEncoder->SetCheckSumKey("01"); {/codecitation}

Next, Add KLV Items: {codecitation width=""}

// Key 02   | A timestamp.  Unix Time Stamp - Microseconds L = 8. // Mon Jan 12 2009 22:08:22 (UTC) 00 04 60 50 58 4E 01 80

unsigned __int64 val_64 = 1231798102000000; // After endian swap -{0x00,0x04,0x60,0x50,0x58,0x4E,0x01,0x80};

char key = 2;

klvEncoder->AddKlvItem(key, val_64);

// Key 05   | Add Platform Heading Angle    | 0x71C2        | 159.9744 Degrees unsigned short val_16 = 0x71C2;

key = 5;

klvEncoder->AddKlvItem(key, val_16);

// Key 06  | Add Platform Pitch Angle      | 0xFD3D        | -0.4315251 Degrees val_16 = 0xFD3D;

key = 6;

klvEncoder->AddKlvItem(key, val_16);

//    Key 07  | Add Platform Roll Angle      | 0x08B8         | 3.405814 Degrees val_16 = 0x08B8;

key = 7;

klvEncoder->AddKlvItem(key, val_16); . . .

{/codecitation}

Next, encode KLV Items and put the result into buffer {codecitation width=""}

// 6. Encode and return an encoded byte array

pEncChunk = klvEncoder->Encode(encodedLength); // 7. Use the results

if( encodedLength )

{ // Do something with the data

memcpy(klvBuffer, pEncChunk, encodedLength); } // 9. Delete the KlvEncoder and deallocate memory delete klvEncoder;

{/codecitation}

Another example. Parse previously encoded buffer and create a list of  Klv Items {codecitation width=""}

// 1. Create STANAG 4609 KLV decoder

IKlvDecoder* klvDecoder = CreateKlvDecoder(); // 2. Parse the buffer that contains Klv encoded data

if( klvDecoder->Parse(IKlvItem::SIXTEEN_BYTES, IKlvItem::ONE_BYTE, klvBuffer, encodedLength ))

{ int itemCount;

IKlvItem** itemArray = klvDecoder->GetItemList(itemCount); char valueStr[256];

for(int i = 0; i < itemCount; i++)

{ const char* keyStr = itemArray[i]->GetKeyString(); int length = itemArray[i]->GetLength();

unsigned char* value = (unsigned char* )itemArray[i]->GetValue(); for(int i=0; i<length; i++)

sprintf(valueStr + i*2, "%02X", *(value+i)); cout << keyStr << ":     Ox" << valueStr << endl; } } //3. Delete KLV Decoder

delete klvDecoder; {/codecitation}

Here is a complete sample code  (LDS) / (UDS) . Please see an online documentation for more details.

{xtypo_download} KLV Lib Available as C/C++ library. Please register to download the Demo

version (for Windows) . This way you

can freely evaluate the software before making a purchase decision. 

{/xtypo_download}

KLV Lib is a C++  library (available for Windows) . It includes both KLV encoder and decoder. A .Net wrapper is available upon request.

You can download the evaluation copy of the KLV lib ( C++). There is a simple test application (installed at  C:Program FilesImpleoTvKLV LibKlvTestAp) which is pretty much

self-explanatory. It encodes and then decodes back some sample data given in one of the standards.

The demo library is fully functional, but has 10 min per session limitation. {phocadownload view=file|id=1|text=KlvLibDemo.zip|target=s}

Buy KLV Lib SDK

Here is the pricing information (royalty-free, library includes both encoder and decoder ):   *     Developer License      1 personal, nontransferable, nonexclusive, royalty-free license *     Small Business License      3 nontransferable, nonexclusive, royalty free DEVELOPER licenses

*     Corporate License       unlimited nontransferable, nonexclusive, royalty free DEVELOPER licenses

Licenses

Developer €299.00 EUR Small Business €499.00 EUR Corporate €599.00 EUR

Delivery will be done (through email) within 24 hours after you place your order.

{xtypo_info}Please do not hesitate to contact us should you have any questions or need help with the integration. {/xtypo_info}

References

Related documents

DeVilbiss coalescer filter units are designed with a quick-release bowl and spin-off element for filter changes without tools. In addition, a filter-change indicator alerts

The primary objectives of this study were to assess the prevalence and nature of single-word comprehension problems in individual PPA patients with speech apraxia and/or agrammatism

From the price comparison existing Bioavtur with aviation fuel at this time with consideration of raw materials, crude oil prices, the demand for aviation fuel is very

With the information entered correctly (as shown above), click on the folder icon to establish the backup destination. When you do so the first time you will be asked a question

Changes to Earned Revenue Ratio below 2% (either positive or negative) were not considered significant for the purposes of this study and correlating years of comparative

Themes that were evident among research showed that some benefits of community art making in the form of mural making could include individual and group identity development,

In this work we present an analysis of aerosol microphysical properties during a mineral dust event tak- ing advantage of the combination of different state-of-the- art

Autologous HSP peptide complex-96 (HSPCC-96 [Oncophage]) has been evaluated in several clinical trials that have demonstrated evidence of immune responses and ob- jective