View Full Version : Why does DirectShow use so much CPU compared to others?
videomixer9
11th September 2005, 18:11
On Windows most DirectShow Players actually consume a more or less notable CPU load, my Athlon XP 3000+ with usual MPEG4 Video between 5%-20% in Zoomplayer with Overlay Mixer and ffdshow decoding.
The same work done with mplayer or vlc produces, even with using the same decoding libraries, but without using a directshow filterchain a load of 0%-3%.
For h264 video it is almost the same, while h264 uses 30-50% of CPU with libav decoding with a directshow filterchain and overlay mixer output, it uses at max 30% with high motion things in high profile on mplayer and idles at around 0-5% with low motion scenes.
I tried with graphedit and the result was after connecting at multiple outputs with the null renderer that most cpu load was produced after the video went through ffdshow.
I also tested CrystalPlayer, it seems to use the Overlay Mixer output, and even ffdshow for decoding the video and audio, yet has cpu usage for playing MPEG4 video that idles around 0-2%.
So my question is, why does the video processed by directshow use so much cpu load, where is that load generated, is the data before it gets outputted to the screen going through the filter chain in RAW format? And is there no chance to get DirectShow to not produce that much overhead CPU usage?
thx in advance :confused:
Sirber
11th September 2005, 18:13
disabling DShow right away :D
Smile2
11th September 2005, 19:08
Post processing filters?
videomixer9
11th September 2005, 19:34
Of course not, I wanted to get an answer by someone with more insights than the noobs that seem to answer here as ppl recommended me this forum for such matters. So pls spare me with idiotic answers of no value that fill up the thread with useless junk that needs to be filtered out later, I don't have any problems with playback or anything, all I wanna know is why DirectShow produces the additional overhead compared to mplayer or VLC or even CrystalPlayer, because I cannot accept that it is just not optimized enough or anything as that seems to be not the real case, so I wanted to know where and on what DShow wastes those CPU cycles.
Anyone sane will notice the difference in CPU load. I hate any post-processing btw. and I don't see much need for it, but that doesn't matter for my question.
Sirber
11th September 2005, 21:10
I wanted to get an answer by someone with more insights than the noobs that seem to answer here as ppl recommended me this forum for such matters. So pls spare me with idiotic answers of no value that fill up the thread with useless junk that needs to be filtered out later.Relax and don't insult people. :o
stax76
12th September 2005, 00:52
I got about 3% with VLC and about 10% with Zoom Player using the same CPU. If you can't get a anwer here you might get a anwer by sending a polite request to the ffdshow developer.
Mug Funky
12th September 2005, 04:29
@ videomixer9:
you'll get no help posting like that. noobs, huh? better be careful or you'll get pwned by a particular clueless n00b :) you're new and seem to have something to offer, so i'm not worried (besides i'm not a mod, so it's not like i have a say...). but i don't think it's healthy to stress so much about CPU load :). if you really need the lowest possible CPU usage while decoding videos, then you've already found the answer - ffmpeg, mplayer, VLC, whatever it may be.
on your question - i've observed this phenomenon of course, and so has just about everyone here who uses windows/dshow/mplayer/etc. it's interesting what you say about crystal player not using this much CPU though still using ffdshow to decode. very interesting. i'm sure milan et al will be pleased to hear it :)
so then there must be something different about what crystalplayer is doing. perhaps it's pre-making optimal filter graphs? perhaps it's got it's own method of using directshow without all the bloat (just using the .ax files directly perhaps?).
i think there's an MS dev here who works on directshow. maybe he'll step in...?
Neo Neko
12th September 2005, 05:16
Yes everyone lets keep civil.
I have noticed the same thing. Which is why VLC is my default player for most everything on every system. My guess albeit uneducated is that there may be some unneeded color space conversions. That sort of thing can incur a decent bit of CPU especially if it has to be converted back. It shouldn't be that different considering that alot of the core code is FFMPEG. The only difference is the wrapper.
videomixer9
12th September 2005, 12:12
That indeed sounds like a possibility, however before the video gets outputted there is only the ffdshow filter and the original video renderer which would make me wonder when those conversions would occur (of course with all ffdshow filters off). And I'm not sure about if it has anything to do with ffdshow, as even other decoder libs like original Xvid don't seem to really consume much CPU on regular modern CPUs without any major post-processing, yet do have noticeable usage with DShow.
as to CrystalPlayer, it seems to inform itself about the installed codecs and uses it's own filter chain then for video playback, in the settings menu it shows used components and ffdshow appears there for me, I tried adding some video noise to confirm it really uses the decoder and after hitting apply it seemed to work fine.
However, it seems there is a large base of ppl that think the actual decoder would eat up all the CPU cycles, which isn't the case as it seems for a 3 Ghz or equal CPU really (okay for old CPUs that really matters but there were reports of MPEG4 decoding fine now with old pentium 200 or even less with an optimized mplayer + libav).
bill_baroud
12th September 2005, 16:03
perhaps there is something to dig in this thread : http://forum.doom9.org/showthread.php?t=99402
Directshow seems to do more memory copies than mplayer, or not, well that's something to investigate (although copying memory waste cpu cycles, i don't know if it has an impact on cpu utilization)
movax
12th September 2005, 16:21
As someone with my main comps containing speedy processor(s), I really don't care much about DShow's CPU inefficiency that much, but on my older systems (P2-400) it indeed is a pain, and I have to use mplayer or similar. I assume it's just some type of overhead you have to keep, much like AVI/MKV overhead, but now I'm just ranting. :)
Doobie
13th September 2005, 17:26
Maybe it's a setting, but for my Crystal Player uses the most CPU time of various players on my computer. Nero Showtime uses the least.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.