Include pts in incoming video and audio frames

This commit is contained in:
Martin Liu
2025-11-12 18:36:56 -05:00
parent 54e8d29615
commit 8dfc59be13

View File

@@ -332,6 +332,7 @@ class SmallWebRTCClient:
format="RGB",
)
image_frame.transport_source = video_source
image_frame.pts = frame.pts
del frame # free original VideoFrame
del image_bytes # reference kept in image_frame
@@ -379,6 +380,7 @@ class SmallWebRTCClient:
sample_rate=resampled_frame.sample_rate,
num_channels=self._audio_in_channels,
)
audio_frame.pts = frame.pts
del pcm_bytes # reference kept in audio_frame
yield audio_frame
@@ -393,6 +395,7 @@ class SmallWebRTCClient:
sample_rate=frame.sample_rate,
num_channels=self._audio_in_channels,
)
audio_frame.pts = frame.pts
del pcm_bytes # reference kept in audio_frame
yield audio_frame