[Python] RTSP stream gray and laging [closed]

Discussão em 'Python' iniciado por Stack, Março 3, 2025.

  1. Stack

    Stack Membro Participativo

    I have this code where i want to stream the rtsp link via opencv but when i run this code the stream opens with all gray and blur pixels which when somethings moves in the stream then the colors and actual stream is shown and the rest of the pixels are just gray and blur.

    import cv2

    # RTSP stream URL
    RTSP_URL = "rtsp://192.168.144.25:8554/main.264"

    # Open RTSP stream using OpenCV
    cap = cv2.VideoCapture(RTSP_URL)

    if not cap.isOpened():
    print("❌ Error: Unable to open RTSP stream.")
    exit()

    print("✅ RTSP Stream Opened Successfully")

    while True:
    ret, frame = cap.read()
    if not ret:
    print("⚠️ Frame missing! Retrying...")
    continue

    cv2.imshow("RTSP Stream", frame)

    # Press 'q' to exit
    if cv2.waitKey(1) & 0xFF == ord('q'):
    break

    cap.release()
    cv2.destroyAllWindows()


    and the errors/warning shown in the terminal are:

    [hevc @ 0x182b4340] Could not find ref with POC 6
    [hevc @ 0x1828ffc0] Could not find ref with POC 0
    [hevc @ 0x185ddb10] Could not find ref with POC 12
    qt.qpa.plugin: Could not find the Qt platform plugin "wayland"
    in "/home/raspberrypi/bird_motion/lib/python3.11/site-
    packages/cv2/qt/plugins"
    [hevc @ 0x182b4340] Could not find ref with POC 15
    [hevc @ 0x1828ffc0] Could not find ref with POC 17
    [hevc @ 0x182e0050] Could not find ref with POC 20
    [hevc @ 0x185ddb10] Could not find ref with POC 25
    [hevc @ 0x182b4340] Could not find ref with POC 27
    [hevc @ 0x182e0050] Could not find ref with POC 0
    [hevc @ 0x182b4340] Could not find ref with POC 3
    [hevc @ 0x1828ffc0] Could not find ref with POC 19
    [hevc @ 0x182e0050] Could not find ref with POC 3
    [hevc @ 0x185ddb10] Could not find ref with POC 5
    [hevc @ 0x1828ffc0] Could not find ref with POC 12
    [hevc @ 0x185ddb10] Could not find ref with POC 15
    [hevc @ 0x182b4340] Could not find ref with POC 22
    [hevc @ 0x182e0050] Could not find ref with POC 25
    [hevc @ 0x185ddb10] Could not find ref with POC 27
    [hevc @ 0x182b4340] Could not find ref with POC 3
    [hevc @ 0x1828ffc0] Could not find ref with POC 9
    [hevc @ 0x182e0050] Could not find ref with POC 18

    Continue reading...

Compartilhe esta Página