FFmpeg:协议不在白名单“文件"上! [英] FFmpeg: Protocol not on whitelist 'file'!
本文介绍了FFmpeg:协议不在白名单“文件"上!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从RTP流中读取,但是当我在avformat_open_input()
中指定"test.sdp"时,会显示以下消息:
I want to read from an RTP stream, but when I specify "test.sdp" to avformat_open_input()
I get this message:
[rtp @ 03928900] Protocol not on whitelist 'file'!
Failed: cannot open input.
avformat_open_input() fail: Invalid data found when processing input
通常,如果我在控制台上使用ffplay,我会添加选项-protocol_whitelist file,udp,rtp
,它将正常工作.
Normally if I were using ffplay on the console, I would add the option -protocol_whitelist file,udp,rtp
and it would work fine.
所以我尝试了这个:
AVDictionary *d = NULL;
av_dict_set(&d, "protocol_whitelist", "file, udp, rtp", 0);
ret = avformat_open_input(&inFormatCtx, filename, NULL, &d);
但是仍然弹出相同的消息.有什么想法吗?
But the same message still pops up. Any ideas?
推荐答案
这很尴尬...
avformat_open_input
失败,因为我有空格.现在可以删除空格.
avformat_open_input
failed because I have white spaces. Removing the whitespaces now work.
av_dict_set(&d, "protocol_whitelist", "file,udp,rtp", 0);
这篇关于FFmpeg:协议不在白名单“文件"上!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文