SL_EncodedStreamPacket Struct Reference

Single encoded video packet retrieved from a Camera source. More...

Data Fields

const unsigned char * data
 
uint64_t size
 
uint64_t timestamp_ns
 
enum SL_STREAMING_CODEC codec
 
int is_keyframe
 
enum SL_ENCODED_STREAM_SOURCE source
 

Detailed Description

Single encoded video packet retrieved from a Camera source.

Payload is laid out as Annex-B NAL units. The first packet handed back on a given source is always an IDR, with SPS/PPS (and VPS for HEVC) inlined in front, so writing successive packets to a .h264 / .hevc file produces a stream playable by any standard player.

Note
data is owned by the SDK and remains valid until the next call to sl_retrieve_encoded_stream_packet() on the same source, or until the Camera is closed. Other calls do not invalidate the buffer. Copy the bytes out if you need them longer.

Field Documentation

◆ data

const unsigned char* SL_EncodedStreamPacket::data

Annex-B NAL units. SDK-owned.

◆ size

uint64_t SL_EncodedStreamPacket::size

Length of data in bytes.

◆ timestamp_ns

uint64_t SL_EncodedStreamPacket::timestamp_ns

Capture timestamp (ns).

◆ codec

enum SL_STREAMING_CODEC SL_EncodedStreamPacket::codec

H264 or H265.

◆ is_keyframe

int SL_EncodedStreamPacket::is_keyframe

Non-zero if this packet is an IDR.

◆ source

enum SL_ENCODED_STREAM_SOURCE SL_EncodedStreamPacket::source

Which path produced this packet.