Skip to content

Instantly share code, notes, and snippets.

@bml1g12
bml1g12 / 1_worker_producer_shared_memory.py
Last active March 9, 2021 18:59
Shared memory for communicating Numpy arrays
def worker_producer_shared_memory(np_arr_shape, shared_memory, n_frames):
"""A frame producer function that writes to shared memory"""
mp_array, np_array = shared_memory
for _ in range(n_frames):
mp_array.acquire()
np_array[:] = prepare_random_frame(np_arr_shape) # produce a fresh array
@YunghuiHsu
YunghuiHsu / rtsp_processor.py
Last active November 9, 2025 18:10
demo for RTP and RTCP Buffer parse with GStreamer
demo for RTP and RTCP Buffer parse with GStreamer
1. This example program is designed to work with the deepstream / gstreamer python API
to calculate the latency of an rtsp transfer.
2. The gstreamer element example is modified from NVIDIA-AI-IOT/deepstream_python_apps/
deepstream_test1_rtsp_in_rtsp_out.py.