diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp index 2188c25444..47dc00ab04 100644 --- a/modules/videoio/src/cap_ffmpeg_impl.hpp +++ b/modules/videoio/src/cap_ffmpeg_impl.hpp @@ -980,7 +980,11 @@ bool CvCapture_FFMPEG::open(const char* _filename, const VideoCaptureParameters& char* options = getenv("OPENCV_FFMPEG_CAPTURE_OPTIONS"); if(options == NULL) { +#if LIBAVFORMAT_VERSION_MICRO >= 100 && LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(55, 48, 100) + av_dict_set(&dict, "rtsp_flags", "prefer_tcp", 0); +#else av_dict_set(&dict, "rtsp_transport", "tcp", 0); +#endif } else {