Merge pull request #21561 from cudawarped:ffmpeg_prefer_tcp_default

Default FFMPEG VideoCapture backend to rtsp_flags=prefer_tcp

* Make the VideoCapture ffmpeg backends default rtsp connection type prefer_tcp.

* Ensure that the ffmpeg version of avformat is checked.
pull/21596/head
cudawarped 3 years ago committed by GitHub
parent d5ecb5ff5a
commit 76aff84788
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      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
{

Loading…
Cancel
Save