Skip to content

Instantly share code, notes, and snippets.

@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.
# caculate loss (forrward)
start_forward = time.time()
outputs = model(samples)
loss = criterion(outputs, targets)
end = time.time()
# caculate loss (forrward) & log time
torch.cuda.synchronize()