pub struct Packet {
pub stream_index: usize,
pub pts: Option<i64>,
pub dts: Option<i64>,
pub duration: i64,
pub end_position: Option<i64>,
pub time_base: Rational,
pub data: Vec<u8>,
pub flags: PacketFlags,
}Expand description
A compressed packet belonging to a single stream.
Fields§
§stream_index: usizeIndex of the stream this packet belongs to within its container.
pts: Option<i64>Presentation timestamp, in the stream’s time_base units. None if unset.
dts: Option<i64>Decode timestamp, in the stream’s time_base units. None if unset.
duration: i64Duration of this packet, in time_base units (0 if unknown).
end_position: Option<i64>Where the stream’s decoded output ENDS once this packet is decoded, in
time_base units, when the container records it — Ogg’s granule
position, which sits on the last packet completing each page (None
on the others, and in containers without one). Unlike pts it marks an
end, not a start: decoders count samples from it to trim end padding
off the end_of_stream packet.
time_base: RationalThe stream time base these timestamps are expressed in.
data: Vec<u8>The compressed payload.
flags: PacketFlagsPacket flags (keyframe, …).