STANAG 4609 Player .NET SDK  Version 3.9.1
File / Network Stream Playback and Klv Extraction

File / Stream Playback.

STANAG Player SDK allows both file and low latency stream playback as well as HLS playback (with file segments stored locally or at the http server)

This is an example of STANAG Player SDKSDK usage in STANAG 4609 file / stream player application.

There are 4 steps:

Phase Description
Creating Instance Create player instance
Setting events Add events (playback, detection, frame / data / errors)
Configure params Configure operational mode and other parameters
Call commands Start / Stop, etc

Use Case.

Demo Application receives a stream url (or file path) as an input parameter, detects video and KLV metadata information and plays back the video. To perform this task, the KlvPlayerLib instance will be used. For more details on the interfaces please see IStCoreWr.

Creating Player Instance.

First, make sure you have all prerequisites in place. For more info on Prerequisites.

Create the player instance:

// Create Player instance
CKlvPlayer m_KlvPlayer = new CKlvPlayer();

Configuring events.

Set up events

// Setup events
m_KlvPlayer.PlayerEvent += new NotifyPlayerEvent(OnPlayerEvent); // Player general events notification
m_KlvPlayer.ErrorEvent += new NotifyError(OnErrorEvent); // Player error events
m_KlvPlayer.PidDetectionEvent += new NotifyPidDetection(OnPidDetectionEvent); // PID detection events (video / KLV / audio / data)
m_KlvPlayer.SyncFrameEvent += new NotifySyncFrame(OnSyncFrameEvent); // Synchronized Video frames / Klv / Private data. For more info on Video / Data sync see \ref pageSync

Initializing Player

Initialize the Player

// Setup Url for network playback. You can pass multiple parameters via url.
// For example, udp://227.1.1.1:30120/nic=172.16.106.10/timeout=10000 allows you
// to setup network interface (nic) and timeout parameters in addition to the IP address and Port.
Uri Url = new Uri(@"udp://227.1.1.1:30120");
// You can set a caching time. Caching time interval (in ms) allows initial caching configuration.
// Increase its value to achieve smooth network playback. Decrease the value of this parameter in order to achieve a low latency playback.
m_KlvPlayer.Caching = 300;
// Initialize
m_KlvPlayer.Init(Url.OriginalString);

Optional parameters:

m_KlvPlayer.RenderVideo - true / false // Set to true if you want to render the video, false if you don't need it (when you only need metadata or decoder frames)
m_KlvPlayer.RenderAudio - true / false // Set to true if you need audio processing.
m_KlvPlayer.VideoCaptureMode.uncompressedVideo -
UncompressedVideoMode_None
UncompressedVideoMode_Rgb
UncompressedVideoMode_Yuv
UncompressedVideoMode_Grayscale
m_KlvPlayer.VideoCaptureMode.fCompressedVideo - true / false // set to true if you don't need an uncompressed frame, but still want to get video timing info.
m_KlvPlayer.Hwnd // Window handle to render video to. If set to 0, the window will be created internally.
m_KlvPlayer.Caching - buffer size in ms // Caching for dejitter buffer. Set to minimal possible value to get a low latency stream playback,
m_KlvPlayer.MaxSyncDelay - buffer size in ms // Allowed Sync time for video / data synchronization
m_KlvPlayer.CalculatePacketRate - true / false // Enable / disable Calculation of average rate for received packets

Starting Player

Now, all you need is to start playback.

// Start Playback
m_KlvPlayer.Start();

Video will be rendered in the Window provided during the initialization phase and OnKlvDataEvent method will be called on Klv data arrival.

Playback Events

During the playback, the relevant events (if set) will be fired.

Player Events.

For a complete code sample please see Playback Sample (console)

Untitled 1




 Copyright 2019,    IMPLEOTV SYSTEMS LTD