AVDictionary* options = nullptr; av_dict_set(&options, "timeout", "3000000", 0); //设置超时断开连接时间 if (avformat_open_input(&pFormatCtx, url, NULL, &options) != 0) { printf("Couldn't open input stream.(无法打开输入流)\n"); return -1; }
https://www.jianshu.com/p/e75e3f1fb6b0?tdsourcetag=s_pcqq_aiomsg