Using H.264, H.265, and AAC Codecs
We recommend that you start by reviewing the sending of frames over the network using the NDI® SDK. The Advanced SDK is designed to operate almost identically, although you can send compressed data streams directly.
Currently the Advanced SDK supports H.264 or H.265 compression at a very wide variety of bitrates, resolutions, and framerates; and it would be common for you to use hardware-assisted compression to generate the compressed video stream on Advanced SDK devices, then send this onto the network using the NDI Advanced SDK. AAC audio is supported for audio transmission.
To send a compressed video frame, you should use the Advanced SDK structure NDIlib_compressed_packet_t
to pack your data. You should allocate memory for your packet so that the following data will be in a single block:
Size and Type | Name | Details |
---|---|---|
uint32_t, 4 bytes | version | This represents the current version number of the structure. This should be set to |
uint32_t, 4 bytes | fourCC | This is the FourCC for the current compression format. Currently H.264 is supported, although other formats might be available in the future.
|
int64_t, 8 bytes | pts | The stream presentation time stamp. See notes in the next section. |
int64_t, 8 bytes | dts | The stream display time stamp. See notes in the next section. |
int64_t, 8 bytes | reserved | This is currently a reserved field and will not be propagated by the SDK. |
uint32_t, 4 bytes | flags | The flags that apply to this frame. Currently there are two supported values for this setting:
|
uint32_t, 4 bytes | data_size | The size of the compressed video frame. |
uint32_t, 4 bytes | extra_data_size | The size of the ancillary extra data for the current codec settings. This is required for key-frames in most compressed video formats. |
data_size bytes | [data] | This is the compressed video frame data in byte format. |
extra_data_size bytes | [extra_data] | This is the compressed ancillary data if |
Last updated