![]() |
Jetson Inference
DNN Vision Library
|
Hardware-accelerated H.264/H.265 video encoder for Jetson using GStreamer. More...
#include <gstEncoder.h>
Public Member Functions | |
~gstEncoder () | |
Destructor. More... | |
bool | EncodeRGBA (uint8_t *buffer) |
Encode the next fixed-point RGBA frame. More... | |
bool | EncodeRGBA (float *buffer, float maxPixelValue=255.0f) |
Encode the next floating-point RGBA frame. More... | |
bool | EncodeI420 (void *buffer, size_t size) |
Encode the next I420 frame provided by the user. More... | |
uint32_t | GetWidth () const |
Retrieve the width that the encoder was created for, in pixels. More... | |
uint32_t | GetHeight () const |
Retrieve the height that the encoder was created for, in pixels. More... | |
Static Public Member Functions | |
static gstEncoder * | Create (gstCodec codec, uint32_t width, uint32_t height, const char *filename) |
Create an encoder instance that outputs to a file on disk. More... | |
static gstEncoder * | Create (gstCodec codec, uint32_t width, uint32_t height, const char *ipAddress, uint16_t port) |
Create an encoder instance that streams over the network. More... | |
static gstEncoder * | Create (gstCodec codec, uint32_t width, uint32_t height, const char *filename, const char *ipAddress, uint16_t port) |
Create an encoder instance that outputs to a file on disk and streams over the network. More... | |
Protected Member Functions | |
gstEncoder () | |
bool | buildCapsStr () |
bool | buildLaunchStr () |
bool | init (gstCodec codec, uint32_t width, uint32_t height, const char *filename, const char *ipAddress, uint16_t port) |
Static Protected Member Functions | |
static void | onNeedData (_GstElement *pipeline, uint32_t size, void *user_data) |
static void | onEnoughData (_GstElement *pipeline, void *user_data) |
Protected Attributes | |
_GstBus * | mBus |
_GstCaps * | mBufferCaps |
_GstElement * | mAppSrc |
_GstElement * | mPipeline |
gstCodec | mCodec |
bool | mNeedData |
uint32_t | mWidth |
uint32_t | mHeight |
std::string | mCapsStr |
std::string | mLaunchStr |
std::string | mOutputPath |
std::string | mOutputIP |
uint16_t | mOutputPort |
void * | mCpuRGBA |
void * | mGpuRGBA |
void * | mCpuI420 |
void * | mGpuI420 |
Hardware-accelerated H.264/H.265 video encoder for Jetson using GStreamer.
The encoder can write the encoded video to disk in .mkv or .h264/.h265 formats, or handle streaming network transmission to remote host(s) via RTP/RTSP protocol.
gstEncoder::~gstEncoder | ( | ) |
Destructor.
|
protected |
|
protected |
|
protected |
|
static |
Create an encoder instance that outputs to a file on disk.
|
static |
Create an encoder instance that streams over the network.
|
static |
Create an encoder instance that outputs to a file on disk and streams over the network.
bool gstEncoder::EncodeI420 | ( | void * | buffer, |
size_t | size | ||
) |
Encode the next I420 frame provided by the user.
Expects 12-bpp (bit per pixel) image in YUV I420 format. This image is passed to GStreamer, so CPU pointer should be used.
buffer | CPU pointer to the I420 image |
bool gstEncoder::EncodeRGBA | ( | uint8_t * | buffer | ) |
Encode the next fixed-point RGBA frame.
Expects 8-bit per channel, 32-bit per pixel unsigned image, range 0-255. It is assumed the width of the buffer is equal to GetWidth(), and that the height of the buffer is equal to GetHeight(). This function performs colorspace conversion using CUDA, so the buffer pointer is expected to be CUDA memory allocated on the GPU.
buffer | CUDA pointer to the RGBA image. |
bool gstEncoder::EncodeRGBA | ( | float * | buffer, |
float | maxPixelValue = 255.0f |
||
) |
Encode the next floating-point RGBA frame.
It is assumed the width of the buffer is equal to GetWidth(), and that the height of the buffer is equal to GetHeight(). This function performs colorspace conversion using CUDA, so the buffer pointer is expected to be CUDA memory allocated on the GPU.
buffer | CUDA pointer to the RGBA image. |
maxPixelValue | indicates the maximum pixel intensity (typically 255.0f or 1.0f) |
|
inline |
Retrieve the height that the encoder was created for, in pixels.
|
inline |
Retrieve the width that the encoder was created for, in pixels.
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |