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 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
| enum MediaStreamState |
| enum ServerLinkState |
| enum ServerLinkError |
Defines the set of Server communication link errors.
| enum AspectRatio |
