在使用ffmpeg播放网络流中,在执行到avformat_stream_info函数会阻塞5秒左右,这样造成播放等待时间过长,影响
用户体验,经试验,修改函数里面AVFormatContext参数,probesize和max_analyze_duration值大小
通过AVDictionary来改变AVFormatContext结构体里参数。
AVDictionary * avdic = NULL;
av_dict_set(&avdic,"probesize","2048",0);
av_dict_set(&avdic,"max_analyze_duration","1000",0);
avforamt_open_input(&pFormatCtx,url, NULL, &avdic);
avformat_find_stream_info(pFormatCtx, NULL);