[Libav-user] Problems receiving RTP stream

Yu Ang Tan isoboy at gmail.com
Tue Sep 13 04:53:25 EEST 2016


Hey Nahra,

You can pass the SDP file using AVDictionary like so:

AVDictionary *d = NULL;
av_dict_set(&d, "protocol_whitelist", "file, udp, rtp", 0);
ret = avformat_open_input(&inFormatCtx, filename, NULL, &d);

Have you made any progress since? I am trying to receive an RTP stream, but
I encountered an error at `avcodec_open2()`:

        [pcm_mulaw @ 02e00ae0] PCM channels out of bounds

Regards,
YTan


On Sat, 18 Jun 2016 at 02:39 Leonardo Nahra <leonardonahra at gmail.com> wrote:

> Hello,
>
> 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:
>
> AVFormatContext *rtpFormatContext;
>
> rtpFormatContext = avformat_alloc_context();
> rtpFormatContext->iformat = av_find_input_format("rtp");
> sprintf_s(rtpFormatContext->filename, sizeof(rtpFormatContext->filename),
> "rtp://%s:%d", ip, port);
>
> avformat_open_input(&rtpFormatContext, rtpFormatContext->filename,
> rtpFormatContext->iformat, NULL);
> avformat_find_stream_info(rtpFormatContext, NULL);
>
> avformat_open_input doesn't create any streams in the rtpFormatContext,
> av_read_frame doesn't read
> correctly, a very descriptive message of the possible problem is shown:
>
> [rtp @ 00487b00] Unable to receive RTP payload type 96 without and SDP
> file describing it
>
> and av_dump_format shows:
>
> Input #0, rtp, from 'rtp://ip:port'
>   Duration: N/A, bitrate: N/A
>
> 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.
> 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.
>
> Thank you, Nahra
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
-- 
Ang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160913/8f4dbfd9/attachment.html>


More information about the Libav-user mailing list