[libav-api] Using libav for reading live stream

Florian Iragne florian at iragne.fr
Tue Sep 9 15:55:43 CEST 2014


I've made a c++ class using libav that decodes input audio files into a 
buffer of double values. It works fine.

Now, i want to handle live streams and add the observer/observee design 
pattern so that external objects can perform various actions on each 
read double buffer.

It works fine if i use an udp stream as input. However, it doesn't work 
if i use an http live stream, if the url looks like 
http://bla.com/foo.mp3 for example.

The stream is available and can be read with various players.

I've added an AVIOInterruptCB to the input format context and the read 
function exits each time the timeout is reached.

Does anybody has a clue on what i'm facing here? Does 
avformat_open_input guess that my live stream is a file due to the 

thanks for your help


More information about the libav-api mailing list