当前位置:网站首页>FFmpeg调用avformat_open_input时返回错误 -22(Invalid argument)
FFmpeg调用avformat_open_input时返回错误 -22(Invalid argument)
2022-07-05 10:57:00 【Mango酱】
一 FFmpeg报错误 -22(Invalid argument)
这个错误确实浪费了我一晚上,为啥呢,因为我打开rtsp的地址是能播放的,但是换成http://xxx/HD.live.mp4?auth_key=xxx这种带鉴权的地址后,就报非法参数了。
长话短说,出现这个错误的原因可能是:
- 1)err = avformat_open_input(&ic, is->_filename.c_str(), is->_iformat, &is->_format_opts);的_filename文件名不对。
- 2)没调用av_register_all()。
- 3)ffmpeg版本不对。
第1个比较常见,但是我想说的是我这次不是这点导致的,而是ffmpeg版本不对,因为我尝试调用了av_register_all(),但是还是不行,而且我确认过这个流地址在vlc以及我自己其它的播放demo都是没问题的。
那么我是怎么猜到可能是ffmpeg版本库的问题呢,
- 1)因为我自己能播放的demo和报错的这份代码是一样的,不一样的只有ffmpeg版本库,所以我尝试把库换掉,结果就好了。
- 2)而且报错的ffmpeg版本是能打开rtsp的地址并播放的,但是换成http://xxx/HD.live.mp4?auth_key=xxx这种带鉴权的地址后,就报非法参数了。估计是这个版本对一些字符解析的不太准确,例如带问号、等号等等,具体的可以自行看源码。
报错版本:ffmpeg-4.3.1,64位(这个是我从官网下载的)。 换成ffmpeg-4.2.1,64位就没问题了(这份是我自己源码编译的)。
边栏推荐
- 2022 Pengcheng cup Web
- [advertising system] parameter server distributed training
- 【广告系统】增量训练 & 特征准入/特征淘汰
- 32: Chapter 3: development of pass service: 15: Browser storage media, introduction; (cookie,Session Storage,Local Storage)
- Cron表达式(七子表达式)
- Bidirectional RNN and stacked bidirectional RNN
- Array
- Broyage · fusion | savoir que le site officiel de chuangyu mobile end est en ligne et commencer le voyage de sécurité numérique!
- Buried point 111
- Detailed explanation of DDR4 hardware schematic design
猜你喜欢
Web3基金会「Grant计划」赋能开发者,盘点四大成功项目
关于vray 5.2的使用(自研笔记)
Do you really understand the things about "prototype"? [part I]
基于昇腾AI丨以萨技术推出视频图像全目标结构化解决方案,达到业界领先水平
Wechat nucleic acid detection appointment applet system graduation design completion (8) graduation design thesis template
Web3 Foundation grant program empowers developers to review four successful projects
在C# 中实现上升沿,并模仿PLC环境验证 If 语句使用上升沿和不使用上升沿的不同
谈谈对Flink框架中容错机制及状态的一致性的理解
赛克瑞浦动力电池首台产品正式下线
Modulenotfounderror: no module named 'scratch' ultimate solution
随机推荐
[SWT component] content scrolledcomposite
Three paradigms of database
华为设备配置信道切换业务不中断
Wechat nucleic acid detection appointment applet system graduation design completion (8) graduation design thesis template
力扣(LeetCode)185. 部门工资前三高的所有员工(2022.07.04)
数据类型 ntext 和 varchar 在not equal to 运算符中不兼容 -九五小庞
基于OpenHarmony的智能金属探测器
Do you really understand the things about "prototype"? [part I]
基于昇腾AI丨以萨技术推出视频图像全目标结构化解决方案,达到业界领先水平
埋点111
Three suggestions for purchasing small spacing LED display
How to close the log window in vray5.2
Web Components
SSL证书错误怎么办?浏览器常见SSL证书报错解决办法
uboot的启动流程:
Basic part - basic project analysis
一次edu证书站的挖掘
磨礪·聚變|知道創宇移動端官網煥新上線,開啟數字安全之旅!
Implement the rising edge in C #, and simulate the PLC environment to verify the difference between if statement using the rising edge and not using the rising edge
NAS and San