<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">A few points of reference:<div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class="">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. </li><li class="">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. </li></ul><div class=""><br class=""></div></div><div class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><font class="Apple-style-span" face="Arial"><span class="Apple-style-span"><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px;"><div style="margin: 0px;" class=""><font face="Helvetica" size="3" style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica;" class=""><font class="Apple-style-span" color="#0000FF">Sincerely,</font></font></div><div style="margin: 0px;" class=""><font face="Helvetica" size="3" style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica;" class=""><font class="Apple-style-span" color="#0000FF">-Blake Senftner</font></font></div></span></font></span></font></span></div></span></div></span></div></span></div></span></div></span></div></span>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Feb 8, 2017, at 2:40 PM, Team Lixo <<a href="mailto:teamlixo@gmail.com" class="">teamlixo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">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.<div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">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:</div><div class=""><br class=""></div><div class=""><ol class=""><li class="">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?</li><li class="">Or, is it possible to achieve the same thing, with each stream being on its own thread (constructing the AVFormatContext, reading input, decoding)?</li></ol><div class="">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</div></div><div class=""><br class=""></div><div class="">Thanks</div></div>
_______________________________________________<br class="">Libav-user mailing list<br class=""><a href="mailto:Libav-user@ffmpeg.org" class="">Libav-user@ffmpeg.org</a><br class="">http://ffmpeg.org/mailman/listinfo/libav-user<br class=""></div></blockquote></div><br class=""></div></body></html>