[Python] FFMPEG RTSP Stream timeout triggered after 30015.187000 ms

Discussão em 'Python' iniciado por Stack, Maio 25, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to read several RTSP streams using opencv cv2.VideoCapture(URL). It has FFMPEG backend. Sometimes for few streams it is throwing timeout warning after 30 seconds.

    [ WARN:0@123.394] global cap_ffmpeg_impl.hpp:453 _opencv_ffmpeg_interrupt_callback Stream timeout triggered after 30015.187000 ms


    I tried setting up the timeout flag.

    import os
    os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "timeout;5000" # 5 seconds
    cv2.VideoCapture("rtsp://URL", cv2.CAP_FFMPEG)


    Ref: How to terminate cv2.VideoCapture(rtsp_url) call if execution stalls due to RTSP camera issues?

    But still, it is waiting for 30 seconds before raising the warning.

    OpenCV version: 4.4.0.x Python version: 3.9.x

    Can we decrease the wait time from 30 seconds to a lower number ?

    Continue reading...

Compartilhe esta Página