AVFormatContext *formatCtx = NULL; formatCtx = avformat_alloc_context(); AVDictionary* options = NULL; av_dict_set(&options, "rtsp_transport", "tcp", 0); avformat_open_input(&formatCtx, pszURLPath, NULL, &options); 转载于:https://www.cnblogs.com/onetaste/p/3996128.html