Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: Problems generating klv subkeys
Started by jpoffen at 03-04-2009 13:45. Topic has 2 replies.

Print Search « Previous Thread Next Thread »
  03-04-2009, 13:45
jpoffen is not online. Last active: 3/4/2009 4:57:20 PM jpoffen

Not Ranked
Joined on 03-04-2009
Posts 2
Problems generating klv subkeys
Reply Quote
I'm trying to create KLV with subkeys, specifically the 0104 universal data set. I used the ConvertKLV example program as the basis for my program. That works great if I'm just adding standalone keys to then ILMMpg2MxT.ILMKlvBuilder interface and writing via the ILMMpg2MxT.WritePrivateData method. However, I'd like to have a key set with subkeys. When I check my klv against some industry parsers, the subkeys don't show as subkeys to the parent key. Does anyone have any suggestions? My code looks something like this (in C#).

// loop for all the metadata
while (there is metadata)
{
    .
    .
    .
// populate data[] for the parent
mux.KlvBuilder.InsertKey(-1, "06 0E 2B 34 02 01 01 01 0E 01 01 02 01 01 00 00", data, 1);

// get a builder for the subkeys
ILMKlvBuilder builder = mux.KlvBuilder.CreateSubBuilder("06 0E 2B 34 02 01 01 01 0E 01 01 02 01 01 00 00");

// populate data[] for subkeys
builder.InsertKey(-1, "06 0E 2B 34 01 01 01 03 07 02 01 01 01 05 00 00", data, 8);
builder.InsertKey(-1, "06 0E 2B 34 01 01 01 01 07 01 02 01 03 02 00 00", data, 8);
builder.InsertKey(-1, "06 0E 2B 34 01 01 01 01 07 01 02 01 03 04 00 00", data, 8);

// write parent private data
mux.WritePrivateData((int)Mpg2MxT_WriteFlag.Mpg2MxT_WriteFlag_PTSValid | (int)Mpg2MxT_WriteFlag.Mpg2MxT_WriteFlag_PTSInSeconds, (double)elapsed / 1000.0, mux.KlvBuilder.GetData(), -1);

// write subkeys
mux.WritePrivateData((int)Mpg2MxT_WriteFlag.Mpg2MxT_WriteFlag_PTSValid | (int)Mpg2MxT_WriteFlag.Mpg2MxT_WriteFlag_PTSInSeconds, (double)elapsed / 1000.0, builder.GetData(), -1);
}

   Report 
  03-05-2009, 11:27
Maen Hasan is not online. Last active: 3/15/2010 4:38:38 PM Maen Hasan



Top 10 Posts
Joined on 08-05-2004
Posts 2,563
Re: Problems generating klv subkeys
Reply Quote
I want to investigate this further. Please send this issue in a new email to support@leadtools.com from a valid email address, and mention this forum post in your email.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
   Report 
  03-05-2009, 11:31
jpoffen is not online. Last active: 3/4/2009 4:57:20 PM jpoffen

Not Ranked
Joined on 03-04-2009
Posts 2
Re: Problems generating klv subkeys
Reply Quote
Never mind, I figured it out with the help of a local KLV expert. The issues is the parent builder needs to use the children keys and the length of that data must be the sum of the 16 byte children keys, plus the size of the length fields, plus the size of the actual values. So in the example above, the 3 key lengths are 3 * 16. Since the data is less than 127 the length is 1 byte, so 3 * 1. Finally the length of the data itself is 3 * 8. Therefore the parent length is 48 + 3 + 24 = 75.

   Report 
Post
LEAD Support Fo... » Developer » Multimedia Filt... » Re: Problems generating klv subkeys

Powered by Community Server, by Telligent Systems