<div dir="ltr">Hey Nahra,<div><br></div><div><span style="line-height:1.5">You can pass the SDP file using AVDictionary like so:</span><br></div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>AVDictionary *d = NULL; </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>av_dict_set(&d, "protocol_whitelist", "file, udp, rtp", 0); </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ret = avformat_open_input(&inFormatCtx, filename, NULL, &d);</div></div><div><br></div><div>Have you made any progress since? I am trying to receive an RTP stream, <span style="line-height:1.5">but I encountered an error at `avcodec_open2()`:</span></div><div><br></div><div> [pcm_mulaw @ 02e00ae0] PCM channels out of bounds<br></div><div><br></div><div>Regards,</div><div>YTan</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, 18 Jun 2016 at 02:39 Leonardo Nahra <<a href="mailto:leonardonahra@gmail.com">leonardonahra@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:12.8px">Hello,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I'm currently trying to receive an RTP streaming, and I'm having problems with opening the stream correctly. This is what I have so far:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">AVFormatContext *rtpFormatContext;</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>rtpFormatContext = avformat_alloc_context();</div><div>rtpFormatContext->iformat = av_find_input_format("rtp");</div><div>sprintf_s(rtpFormatContext->filename, sizeof(rtpFormatContext->filename), "rtp://%s:%d", ip, port);</div><div><br></div><div>avformat_open_input(&rtpFormatContext, rtpFormatContext->filename, rtpFormatContext->iformat, NULL);</div><div>avformat_find_stream_info(rtpFormatContext, NULL);</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">avformat_open_input doesn't create any streams in the rtpFormatContext, av_read_frame doesn't read</div><div style="font-size:12.8px">correctly, a very descriptive message of the possible problem is shown: </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">[rtp @ 00487b00] Unable to receive RTP payload type 96 without and SDP file describing it</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">and av_dump_format shows:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Input #0, rtp, from 'rtp://ip:port'</div><div style="font-size:12.8px"> Duration: N/A, bitrate: N/A</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">The clear hint here is that I need an SDP file, but I don't know how I pass the SDP to the AVFormatContext, and what is the proper way to handle RTP receiving in libavformat.</div><div style="font-size:12.8px">The connection is done via a SIP call, so I have the correct SDP information, I'm just having difficulty in finding how to accomplish this task, I'm very new to using libav, so I thank any help I might get.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thank you, Nahra</div></div>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</blockquote></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">Ang</div></div>