Encoder Component

Detailed Description

The Encoder Component is central to the entire SDK and provides the base level services necessary for the other components to operate.

The core component contains the encoder object, this is the first object to be created and contains all that is required to stream to an EdgeVis server.

Getting started

Use the sample application shipped with the SDK as a starting place. The SDK requires knowledge of video coding, threading and the Android Camera APIs.

Things to be aware of when using the Encoder SDK

  • The video format required is a planner YUV frame in I420 format
  • The image from the camera may require re-sizing, rotating and colour correcting before passing into the SDK
  • Do not use the same thread from the camera callback to pass into the Encoder SDK. Pass this off to a different thread

Permissions

Your application will need to provide the correct permissions. The Encoder SDK requires the following Android permissions to operate:

  • Internet permission
  • Write external storage (For recordings)

Running as a service

If you need the Encoder to run when the application has been put to the background then you must implement the Encoder SDK within a service.

Streaming

A simple diagram showing a simple streaming only implementation. Streamed data must be converted to YCbCr and PCM audio.

streaming

Streaming and Archiving

The Encoder SDK can also record H.264 video in the Digital Barriers CSX file format.

Archiving is an optional feature and must be enabled in the configuration

The conversion from YCbCr frames to H.264 is now performed within the Encoder SDK using the device hardware for maximum efficiency. Viewing clients may initiate recordings playback via the video stream. In this case the H.264 frames are decoded within the SDK and provided to the live video stream. The decoded frames are also provided to the Android application via IArchivePlaybackListener::ArchiveFrameAvailable callback to provide the option of rendering on the device.

See EdgeVisEncoderSDK::Encoder for more information

Threads

Care should be taken with the threading within the EdgeVis SDK.

  • Most calls into the SDK will block until the operation has been complete.
  • Callbacks from the SDK must not be blocked. Any processing resulting in a callback must be passed to a separate thread in your application and the callback complete as soon as possible
  • Callbacks from the SDK must not call back into the SDK on the same thread. Call back into the SDK on a separate thread.

Sample applications

There is a sample Android application demonstrating the core SDK functionality. The sample is provided within the downloaded SDK package.

Classes

class  EdgeVisEncoderSDK::Encoder
 The Encoder object is the main component of the EdgeVis Encoder SDK. More...
 
class  EdgeVisEncoderSDK::IEncoderListener
 The interface listener for the encoder object. More...
 
class  EdgeVisEncoderSDK::YCbCrFrame
 An object containing the YCbCr frame to be encoded. More...
 
class  EdgeVisEncoderSDK::PCMAudio
 An object containing the audio data to be encoded. More...
 

Typedefs

typedef enum MediaStreamState MediaStreamState
 Defines the set of stream states.
 
typedef enum ServerLinkState ServerLinkState
 Defines the set of Server communication link states.
 
typedef enum ServerLinkError ServerLinkError
 Defines the set of Server communication link errors.
 
typedef enum AspectRatio AspectRatio
 Contains the available aspect ratio types.
 

Enumerations

Files

file  EdgeVisEncoderSDK.h
 Convenience header to include all EdgeVisEncoderSDK headers.
 

Enumeration Type Documentation

Defines the set of stream states.

Enumerator
MS_Closed 

The media stream is closed and not streaming.

MS_Streaming 

The media stream is open and streaming.

Defines the set of Server communication link states.

Enumerator
SL_Disconnected 

The Server link is disconnected.

SL_Connected 

The Server link is connected.

SL_Connecting 

The Server link is in the process of connecting.

Defines the set of Server communication link errors.

Enumerator
SE_None 

The Server link has no error condition.

SE_Unlicensed 

The Server link is unlicensed.

SE_EncryptionFail 

The Server link has failed to encrypt.

SE_DNSFail 

The Server link has a DNS failure.

SE_ConnectionFail 

The Server link has a connection failure.

SE_AuthenticationFail 

The Server link has an authentication failure.

SE_NameInUse 

The encoder name provided is already in use.

SE_IncompatibleVersion 

The Server is too old to support this encoder.

SE_LicenceRequestFailed 

The Server has not provided a licence when it was requested.

SE_RequestingLicence 

The Server is requesting a licence.

Contains the available aspect ratio types.

Enumerator
Aspect_Ratio_Unknown 

Aspect ratio is unknown.

Aspect_Ratio_4by3 

Aspect ratio is 4 by 3.

Aspect_Ratio_16by9 

Aspect ratio is 16 by 9.