STANAG 4609 Streamer .Net SDK  Version 1.09
Klv Streamer .Net SDK.

Introduction

KlvStreamer.Net SDK is .Net library that provides re-streaming STANAG TS files over IP functionality.

Main features:

KLV encoded metadata in MPEG Transport streams.

For more details on STANAG 4609 / TS stream and KLV metadata please see STANAG 4609 and KLV metadata in TS

IStreamingSession interface

KlvStreamer.Net SDK exposes StreamerLib::IStreamingSession interface (Main SDK interface)

KlvStreamer.Net SDK provides examples with complete source code to help you get started using the SDK for STANAG File/Stream re-broadcasting.

Getting Started with Klv Streamer

This section contains information designed to get you started quickly.

First, create an instance of a streamer and setup basic parameters and event handlers

m_Streamer = new StreamingSession();
m_Streamer.Id = 0;
m_Streamer.Loop = false; // or true
m_Streamer.SessionStatusChangedEvent += new SessionStatusChangeEventHandler(OnStreamerStateEvent); // setup event to be fired when the streamer's internal state is changed.
m_Streamer.SessionSegmentChangedEvent += new SessionSegmentChangeEventHandler(OnStreamingSegmentChangedEvent); // setup event to be fired when the currently streaming segment is changed.
m_Streamer.SessionErrorEvent += new SessionErrorEventHandler(OnStreamerErrorEvent); // setup event to be fired when error occurs.

KlvStreamer can operate in two modes:

In CBR mode files are transmitted with constant bitrate that either calculated at the beginning or provided as a initialization parameter. During the streaming in CBR mode no parsing of the file is performed. VBR mode is suitable for VBR file steaming. This mode requires continues file parsing in order to detect a proper streaming rate. This mode maybe used for streaming CBR files as well. Note that VBR mode consumes more CPU than CBR one, due to MPEG parsing operation. You can use a SetMode method in order to select a desired operation mode.

m_Streamer.SetMode(STREAMING_MODE.VBR);

Activate Streaming license with your license file and key. Use 'KlvStreamer' as application name.

m_Streamer.Activate("KlvStreamer", @"D:\Streamer\LicenseStr.lic", @"AD3E42A8-4F54DB47-46D37457-85ADB574");

For more info on licensing please see SDK Licensing Model

Add files that should be streamed out and a target

m_Streamer.Reset();
m_Streamer.AddSourceSegment(@"c:\Movie1.ts, TimeSpan.Zero, TimeSpan.Zero, 0);
m_Streamer.AddSourceSegment(@"c:\Movie2.ts, TimeSpan.Zero, TimeSpan.Zero, 0);
m_Streamer.AddTarget("172.16.106.2", "172.16.106.25", 1234, 1316);

Initialize the streamer and start streaming

// Initialize
m_Streamer.Init();
// Start streaming
m_Streamer.Start();
Note
If you have not provided a bitrate in the AddSourceSegment call (for CBR mode only), it will be calculated during the Init, blocking the current thread. You should do this in async call if you don't want to block the GUI.

You can control a streaming rate by calling SetStreamingRate method

m_Streamer.SetStreamingRate(2.0); // Change streaming rate to x2 of real time

In order to get a current position in the playlist, use Position.TotalSeconds property.

double val = m_Streamer.Position.TotalSeconds;

Random access functionality can be achieved using \ Seek method.

m_Streamer.Seek(TimeSpan.FromSeconds(25));

Detecting basic TS stream parameters using Klv Streamer

This section contains information on media parameters detection.

SDK contains a function that provides media detection functionality MediaParams DetectMediaParams(string path);

MediaParams mp = m_Streamer.DetectMediaParams(filePath);
if (mp != null)
{
int bitrate = mp.Bitrate;
int avgBitrate = mp.AverageBitrate;
TimeSpan duration = mp.Duration;
}

Preferences

Glossary of Acronyms

EG - Engineering Guideline
CBR - Constant Bitrate
VBR - Variable Bitrate
FPS - Frames per Second
KLV - Key-Length-Value
MI - Motion Imagery
SI - Situational Awareness
MISP - Motion Imagery Standards Profile
RP - Recommended Practice
SMPTE - Society of Motion Picture and Television Engineers
UTC - Coordinated Universal Time
UUID - Universally Unique Identifier
XML - Extensible Markup Language

Untitled 1




 Copyright 2012,    IMPLEOTV SYSTEMS LTD