Hi everyone!
I'm attempting to execute an example provided by Luxonis/Examples on video streaming via RTSP, and I'm encountering some issues.
I'm operating in an Ubuntu environment:
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
I've attempted to perform the retransmission in both H264 and H265, but in both cases, I'm encountering the following errors.
Here's my H264 codec configuration:
$ apt depends libx264-dev
libx264-dev
Depends: libx264-163 (= 2:0.163.3060+git5db6aa6-2build1)
When I run the script with an H264 configuration, upon opening playback, I receive the following warning:
[h264 @ 0x558109e892c0] Illegal short-term buffer state detected
[h264 @ 0x558109e892c0] Missing reference picture; default is 65540
The Gstreamer LOGS are as follows:

Upon triggering these warnings, the image appears choppy, though the streaming continues to be transmitted:

For H265 here's my codec configuration:
$ apt depends libx265-dev
libx265-dev
Depends: libx265-199 (= 3.5-2)
Suggests: libx265-doc
When I run the script with an H265 configuration, upon opening the streaming window, it works flawlessly until it closes with the following ERROR message:
[hevc @ 0x556682882080] Could not find reference with POC 46
[hevc @ 0x556682944900] Duplicate POC in a sequence: 48
The Gstreamer LOGS are as follows, no error when window is closed this logs appear just when I start script with opencv to view the streaming.

To open a streaming window I use this script:
import cv2
IP = "localhost_IP"
PORT = "PORT"
IMG = "preview"
cap = cv2.VideoCapture(f"rtsp://{IP}:{PORT}/{IMG}")
while True:
ret, frame = cap.read()
if ret:
cv2.imshow("RTSP View H264", frame)
cv2.waitKey(1)
else:
print("unable to open camera")
break
cap.release()
cv2.destroyAllWindows()
Has anyone here encountered this issue? I would appreciate any help or potential avenues of research to resolve this.
Thank you very much in advance.