[Libav-user] [libav-user] demuxing of incoming rtp stream by means of libavformat and custom IO

Dmitry Volyntsev xeioexception at gmail.com
Fri Feb 17 15:48:39 CET 2012

Hi All!

I have a question related to demuxing of incoming rtp stream by means of

1) My program has it own event loop (libevent) and I can't easily integrate
libavformat routines to reading from udp and tcp sockets straightforwardly
2) I already wrote custom IO routines and RTSP protocol negotiator
(communicates with other side and requests streaming from RTSP server to
local udp ports)

What I tried to do:

 ioBuffer_ = (unsigned char *)av_mallocz(_IO_BUFFER_SIZE

 ioContext_ = avio_alloc_context(ioBuffer_, _IO_BUFFER_SIZE,
           0, ptr, my_read, NULL, NULL);

 formatCtx_ = avformat_alloc_context();
 formatCtx_->pb = ioContext_;
 res = avformat_open_input(&formatCtx_, "spf-avs", NULL, NULL);

my_read() - reads incoming raw RTP stream packets

Unfortunately constantly returns AVERROR(EAGAIN)

I just want to feed raw RTP data to libavformat for demuxing  purposes and
just get the pure videodata back for further processing

What should I do for to get it done?

Thanks in advance!

Be happy,
Best regards,
Dmitry Volyntsev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120217/5045c2e3/attachment.html>

More information about the Libav-user mailing list