avformat_open_input 返回失败 -22

fakine 2018-01-16 06:04:21

AVDictionary *avdic = NULL;
av_dict_set(&avdic, "timeout", "6000", 0);//设置超时3秒 都不行。

av_register_all();
avcodec_register_all();
avformat_network_init();

AVDictionary *avdic = NULL;
av_dict_set(&avdic, "timeout", "6000", 0);//设置超时3秒

char url[] = "http://xxxxxxx";


AVFormatContext* pFormatCtx = NULL;
pFormatCtx = avformat_alloc_context();
int err = avformat_open_input(&pFormatCtx, url, NULL, &avdic);
if (err != 0)
{
return -1;
}


打开的是 url
一直返回-22 不知道为什么原因,换一台电脑就没问题了
看了http://bbs.csdn.net/topics/390040155这个帖子
把第一个参数设置null 也不行,
把最后一个参数设置null也不行。
...全文
684 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

2,543

社区成员

发帖
与我相关
我的任务
社区描述
专题开发/技术/项目 多媒体/流媒体开发
社区管理员
  • 多媒体/流媒体开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧