[Libav-user] Problems receiving RTP stream

Leonardo Nahra leonardonahra at gmail.com
Fri Jun 17 18:39:22 CEST 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160617/9fc2fefa/attachment.html>

More information about the Libav-user mailing list