我想從一個RTP流中讀取,但是當我指定「test.sdp」以avformat_open_input()
我得到這個消息:FFmpeg:協議不在白名單'文件'上!
[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
它會正常工作。
所以,我想這一點:
AVDictionary *d = NULL;
av_dict_set(&d, "protocol_whitelist", "file, udp, rtp", 0);
ret = avformat_open_input(&inFormatCtx, filename, NULL, &d);
但同樣的消息仍然彈出。有任何想法嗎?
這實際上並不適用於我......這是你做的唯一改變嗎? – Nitay
是的。如果您查看調試,則將「inFormatCtx-> protocol_whitelist」設置爲「file,udp,rtp」。你能解釋更多關於它如何不適合你的嗎? – bot1131357
當我在字典中設置了protocol_whitelist時,我仍然得到'Protocol not whitelist'錯誤。可能是版本問題?無論如何 - 它現在適用於我們兩個人,所以一切都很好:) – Nitay