I'm developing an application which displays 4 (or even more, if possible) video streams simultaneously in real-time (30 fps per stream). I need a renderer that will take the raw YUV frames and display them to a Win32 window, scaling as required. Each stream is independent of the others, including running in separate threads. Currently, my app has an independent DirectDraw-based renderer for each stream (written by someone else), but performance degrades dramatically (much more than it should) as streams 2-4 start.
I'd like to know how DirectX experts would approach this problem.
Thanks for any advice you have,
Scott

rendering multiple video streams
Sachin1Sharma
It's a problem of compression of the video data...
DirectShow would be the best solution for this, several Graph will run in seperate thread
You can mix DirectX and DirectShow (who is in the Plateform SDK not DX SDK)
The best you can play in DirectX is AVI file that render in texture
Anything else that use compression or filter would need DirectShow
The size of the window stream is important, a 240x240 video is much faster
then a full size 800x600
YUV is for TV low resolution...you expect TV to be better then a screen but it's not
Actually TV is low resolution 420x420 of some low resolution like this
YUV is imperfect bits that use the fact that your eyes cannot make the difference
between many small color change, so you can generate more pixel for less data
Movie allways use Compression MPG will run much faster then AVI
MPG are actually a type of JPG...Loading the AVI Frame is very coslty
Save a BMP file and save it to JPG you will see that the JPG is much smaller
and easier to load
When you render without any compression its jerky at best
No real time feed would not use compression...
Your render speed problem is not cause by the number of stream or by the scale or the size because at worst it will only be in full sreen
The number one problem of video speed is bad compression or none at all...
It's much faster to read small video MPG on disk and to uncompress it
Then to load an uncompress BMP and to copy all it's huge bits array
Basicly it's the reading of your disk data that make this slow...
The CPU and your graphic card are both waiting for this load time...
So you need a better compression of your video
And by the way thank you for your question...I just realize that all my texture
are in BMP...I will convert them to jpg to accelerate the load...
Hope this help and there is a separate forum for DirectShow expert
that would help you with compression
Ray5468
As I continue to research and investigation this problem, I'm starting to think that the culprit is locking the surfaces. When a thread waits on a call to IDirectDrawSurface::Lock, is that wait a busy wait Currently the code waits to return from Lock; I'm going to try changing it to use DDLOCK_DONOTWAIT (and add appropriate handling code) and see if that improves things at all.
I guess my main question is should I be able to have separate threads writing to different surfaces independently from one another without any problems - performance or otherwise Or should I focus on writing a new rendering system that has all DirectDraw calls in one dedicated rendering thread
Thanks,
Scott