当前位置:网站首页>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位就没问题了(这份是我自己源码编译的)。
边栏推荐
- [JS learning notes 54] BFC mode
- C language current savings account management system
- 2021年山东省赛题库题目抓包
- Go-2-Vim IDE常用功能
- C # to obtain the filtered or sorted data of the GridView table in devaexpress
- 九、磁盘管理
- Characteristics and electrical parameters of DDR4
- Paradigm in database: first paradigm, second paradigm, third paradigm
- Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
- SSL证书错误怎么办?浏览器常见SSL证书报错解决办法
猜你喜欢

修复动漫1K变8K

磨礪·聚變|知道創宇移動端官網煥新上線,開啟數字安全之旅!

9、 Disk management

Explanation of message passing in DGL

Wechat nucleic acid detection appointment applet system graduation design completion (6) opening defense ppt

Bidirectional RNN and stacked bidirectional RNN

【广告系统】Parameter Server分布式训练

About the use of Vray 5.2 (self research notes) (II)

2022 t elevator repair operation certificate examination questions and answers

2022 mobile crane driver examination question bank and simulation examination
随机推荐
Go language learning notes - first acquaintance with go language
Explanation of full vulnerability script of network security C module of secondary vocational group script containing 4 vulnerabilities
sklearn模型整理
R3live series learning (IV) r2live source code reading (2)
About the use of Vray 5.2 (self research notes)
[there may be no default font]warning: imagettfbbox() [function.imagettfbbox]: invalid font filename
NAS and San
Repair animation 1K to 8K
Applet framework taro
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
DOM//
Network security of secondary vocational group 2021 Jiangsu provincial competition 5 sets of topics environment + analysis of all necessary private messages I
购买小间距LED显示屏的三个建议
How to introduce devsecops into enterprises?
Go-3-第一个Go程序
不要再说微服务可以解决一切问题了!
Data type
DDRx寻址原理
Detailed explanation of DDR4 hardware schematic design