[Libav-user] Question about usage of libav in an application

Blake Senftner bsenftner at earthlink.net
Thu Feb 9 01:04:16 EET 2017

A few points of reference:

I have not completely unraveled the logic of ffplay, but I think it is using one thread as a reader thread, and when a given piece of media has multiple streams, such as a video stream and an audio stream, then a dedicated thread is created for the video and well as the audio. I think this is so each thread’s logic can be more streamlined and single purpose. 
I have a video player library I wrote, based on libav; it is focused on computer vision applications, so audio, subtitles and anything other than video frames are ignored. In my logic I have a reader thread and a player thread for each video stream, and I have tested my library with 24 independent video streams playing at once. 

-Blake Senftner

> On Feb 8, 2017, at 2:40 PM, Team Lixo <teamlixo at gmail.com> wrote:
> I'm writing an application that will be ingesting multiple live streams at once and managing them, and to do this I've been adapting libav with a custom AVIOContext. The custom context is simply reading from an FLV file for testing purposes before I will feed it an RTMP stream. All of this is tested + proven.
> Everything works fine when only one stream is being ingested, and I'm quite sure I'm going by documentation on this, however when I have multiple streams running at once libav runs into problems reading in packets.
> There is a lot of code to review for this issue I'm having, so I won't bother attaching it all -- but I do have one question concerning the behavior of libav:
> Is it possible to read/decode more than one media stream in one single thread? i.e. round-robin each AVFormatContext, calling av_read_frame once, decoding, and moving onto the next packet/frame in this fashion?
> Or, is it possible to achieve the same thing, with each stream being on its own thread (constructing the AVFormatContext, reading input, decoding)?
> In essence, I am looking to decode multiple streams in one process. Hope this is possible, if it is there is likely something wrong with my code
> Thanks
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20170208/93e16a7a/attachment.html>

More information about the Libav-user mailing list