待解决 avformat_open_input(&pFormatCtx, file_path, NULL, NULL) 一闪而过的问题。

这个win10系统,很让人难过,关闭各处的更新设置,依然不行。只要它想更新,就会把“关机”变成“关机并更新”。

昨天刚配置好的FFmpeg,并且调试通过。https://blog.****.net/qq_34732729/article/details/87184627

结果,今天早上来了,程序到avformat_open_input()就不行了,一闪而过。

一、 尝试方案一:

添加代码如下,初始化网络:结果失败

待解决 avformat_open_input(&pFormatCtx, file_path, NULL, NULL) 一闪而过的问题。

二、尝试方案二:

添加如下代码,

当avformat_open_input()拉不到流,此函数会一直不返回。

通过av_dict_set()函数进行配置,并传入avformat_open_input() 的第四个参数。

如果拉不到流,在timeout时间后,会返回。(发现不论timeout 的值设置多大,依然是一闪而过,跟6000的大小没有丝毫关系)

运行结果,依然一闪而过。结果失败。

 待解决 avformat_open_input(&pFormatCtx, file_path, NULL, NULL) 一闪而过的问题。

三、运行结果截图:

在代码运行过程中, 快速按下PtrScn-SysRp键,进行截屏,如下图:

待解决 avformat_open_input(&pFormatCtx, file_path, NULL, NULL) 一闪而过的问题。

四、 用FFmpeg的ffpaly.exe播放

对比用FFmpeg的ffplay.exe播放,截图如下:

待解决 avformat_open_input(&pFormatCtx, file_path, NULL, NULL) 一闪而过的问题。

其他信息都一样,除了最下面红框是播放信息。