# Decode 12 video streams simultaneously

**URL:** <https://forum.opencv.org/t/decode-12-video-streams-simultaneously/5075>\
**Category:** Python\
**Tags:** performance, videoio\
**Created:** [September 6, 2021, 9:51am UTC](https://forum.opencv.org/t/decode-12-video-streams-simultaneously/5075 "2021-09-06T09:51:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodingArcher](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/codingarcher/32/2686_2.png) [@CodingArcher](https://forum.opencv.org/u/CodingArcher)\
**Post date:** [September 6, 2021, 9:51am UTC](https://forum.opencv.org/t/decode-12-video-streams-simultaneously/5075/1 "2021-09-06T09:51:41Z")

</div>

is it possible to display a videostream with opencv which has been encoded in h264?

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [September 6, 2021, 10:31am UTC](https://forum.opencv.org/t/decode-12-video-streams-simultaneously/5075/2 "2021-09-06T10:31:48Z")

</div>

Yes, you should be able to read it with VideoCapture from a file or an RTSP stream with the FFmpeg backend.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [September 6, 2021, 3:06pm UTC](https://forum.opencv.org/t/decode-12-video-streams-simultaneously/5075/3 "2021-09-06T15:06:21Z")

</div>

why do you ask? what did you try? what precisely happened when you tried?

---

<div class="post-metadata">

**Author:** ![CodingArcher](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/codingarcher/32/2686_2.png) [@CodingArcher](https://forum.opencv.org/u/CodingArcher)\
**Post date:** [September 23, 2021, 9:54am UTC](https://forum.opencv.org/t/decode-12-video-streams-simultaneously/5075/4 "2021-09-23T09:54:13Z")

</div>

I have tried to display them with imshow() and this resulted in wierd gray lines through the frames. I dont know if it is possible to do it without alot of compute power as im having 12 video streams in real time coming into my pc with all need to be decoded and displayed. My threadripper 32Core cpu can just handle it but thats not an ideal setup. If there would be a less compute intensive way to do so that would be amazing 🙂

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [September 23, 2021, 10:40am UTC](https://forum.opencv.org/t/decode-12-video-streams-simultaneously/5075/5 "2021-09-23T10:40:24Z")

</div>

To clarify you want to decode 12 video streams on a lower end cpu than a threadripper or you want to put less stress on the threadripper? What resolution are they?

I am unable to decode more than say 6 1080p streams on a low end 4 core Intel CPU. You could try using hardware decoding if you have an intel CPU or nvidia GPU.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [September 23, 2021, 12:40pm UTC](https://forum.opencv.org/t/decode-12-video-streams-simultaneously/5075/6 "2021-09-23T12:40:00Z")

</div>

threadrippers are _not_ low end, so if that thing has trouble, the video streams must be extra high resolution and high frame rate.

you need to precisely tell us the properties of those streams. numbers. facts.

same with the “weird gray lines”. spare the words if a picture says it better.

> [@How to get faster/lighter video decoding](https://forum.opencv.org/t/how-to-get-faster-lighter-video-decoding/5250):
>
> Hello and thank you in advance for your help! I’m building a simple app at Windows using Intellij and gradle that its purpose is to be able to show a couple, or maybe more, videos (mp4) simultaneously. The code is pretty simple, I am using a thread for capturing a frame and then I use the GUI thread to show it in a panel. My issue is that the decoding is overly using my CPU to the point that the result is far from optimal. I believe that the decode isn’t using any hardware decoders. I’ve looke…
