CasparCG very low performance / high CPU usage compare to other tool?

Hi there, sorry for my poor English.
I’ve being digging CasparCG for days, its wonderful tool for my use.
I used to program in C# by myself to organize videos, and then live broadcast it.
After all my test of CasparCG done, I found its CPU usage are far higher than my own program.

I use these two softwares for 4 videos in1 picture, all same video sources. See below
CasparCG cost around 37% CPU, and my own program cost around 7%, neither of them uses GPU to decode, and no encoding at this moment(only for display)

My own program use nVlc(.NET wapper for VLC lib) to get frames from video source, and use Xenko engine (a .NET game engine) to display them

Actually, you can just use “ffplay” to play a video, its usage is very low, but its high when using CasparCG to play same video, I supposed they could be similar because all use ffmpeg?

any ideas that I can improve this performance issue? many thanks

The screen consumer accounts for around 30% CPU. Outputting to Decklink uses much less.

I removed screen consumer for testing, seems no difference

could you please try this sample
http://jell.yfish.us/media/jellyfish-3-mbps-hd-h264.mkv

simply play it in CasparCG, its around 10% CPU usage
but its only aound 1.6% using FFplay(FFMpeg)

I don’t need to test that to believe you. And I also do not know why there is such a difference in performance. To be honest: I don’t care and I tell you why:

CasparCG is a broadcast character generator / media player / DVE that I (and a lot of very small to very large organizations around the world) use for a lot of funny stuff. My CPU’s and GPU’s can handle the load and it does what I want it to do, so why worry? It is sure possible, that there are tools that can do one or the other thing better or more efficient, but to my knowledge there is no tool that can do all what CasparCG does and can run on a not super expensive hardware and is license free to use.

So if your use case does only need to play these kind of videos and you already have written a program (my respect for that) that performs well, so why use CasparCG? If you want to use other stuff, that Caspar can offer, just use it as it is. If you are a C++ programmer and want to help make CasparCG perform better, you are more than welcome to do so. Find the source code on GitHub.

1 Like

hey , I am not here for some argue, no offence
I am not a C++ programmer, actually I am not a programmer, that’s why I have to use C# which is easier for self learning and coding. and I did check source code and fixed it to get rtsp stream working (FFMpeg producer parameters support?), but that’s really my best effort. just not able to improve the performance

and I am here looking for help, CasparCG is wonderful tool for all my need, I do appreciates alot for saving me time.

this usage situation matters for some ppl I believe, if 4x1080p videos cost 50%, how about 9 or more videos, or 4x4K videos we are sure will be using in a few years

It’s just not a blame, because the huge difference indicates something wrong there, or maybe it is how I use CasparCG, maybe some configuration problem? maybe this only happens on my own PC? I don’t know, and at least I want to know if it is my own problem.

I mean if its not my own problem, other ppl using CasparCG are facing same CPU usage situation and no fix around, then I am fine with it, consider to get more powerful CPU

If what I said make you feel bad, I am sorry for that again

Ok, I was not offended by you post and hope you were not of mine. No, I also don‘t think, that you do something wrong. As Caspar uses a layered output stage, I think a few things are done more complicated, than how FFMPEG or others can do it. That is the price for the flexibility. As hardware prices still drops over time, you will get a 4K ready machine for a good price in a few years, when you need it. Currently most of the stuff is still in HD and that will stay like that for another 3 to 5 years, I guess.

I thought I could get a powerful CPU to support performance, but something still seems wrong

I can’t play a single 4K video smoothly, its 120mbps and 4K h264 video
http://jell.yfish.us/media/jellyfish-120-mbps-4k-uhd-h264.mkv

ffplay(ffmpeg) play it without issue, but CasparCG will be laggy while CPU is only around 10%

its testing on i7-7820x 32G DDR4, nvme ssd
my configuration is

<configuration>
   <paths>
       <media-path>media/</media-path>
       <log-path>log/</log-path>
       <data-path>data/</data-path>
       <template-path>template/</template-path>
   </paths>
   <lock-clear-phrase>secret</lock-clear-phrase>
   <channels>
       <channel>
           <video-mode>1080p3000</video-mode>
           <consumers>
           <screen>
   		</screen>
               <system-audio />
           </consumers>
       </channel>
   	
   	
   	
   </channels>
   <controllers>
       <tcp>
           <port>5250</port>
           <protocol>AMCP</protocol>
       </tcp>
   </controllers>
</configuration>

I do need to make sure if it is my own problem, and its not like CPU power issue since its only cost 10%, then it can’t be work around by getting more powerful CPU…:joy:

What’s your graphics card? The mixer takes a big chunk of GPU to render a video, like @didikunz said.
You keep talking about CPU performance but chances are the bottleneck is somewhere else like an integrated GPU with no dedicated memory.

Hardware recommendation for CasparCG is an Nvidia GPU, preferably a Quadro and also workstation or server chipsets are usually a big advantage due to greater memory bandwith and CPU lanes.

Try to run DIAG in the console and check out where is the performance dropping.

I don’t think it’s hardware problem
I am testing on two pc builds
i7 7820x+4x8G+GTX 1080ti
E5 1660v3(OC 4G)+4x8G+RTX 2060super

they all suppose to be OK to play just one single 4K h264 video
could someone help to check the sample video that I post, to see if it is laggy simply by using “PLAY 1-1 VideoFile”

GPU cost are low when running, actually its not using GPU decoding chip, otherwise this should be fine.
I tried parameters to code inside CasparCG, but seems still not able to get GPU decoding working (but tcp paramater works)

even in cpu-base decoding case, it still should be fine to play a single 4K h264 video, cpu and gpu are low usage.

Have you tried changing the channel format to 1080p2997?
What is DIAG showing?

True. There’s a whole lot of work going on if the file isn’t in the res/framerate of the channel.

hi, rrebuffo
I just tried 1080p2997 after seeing your post, but no lock
I dont know what diag is, tried type it in cmd, but no this command, is it something I need to install? Thanks

diag opens up a new window with performance graphs - nothing to install

do you mean that if the video source res/framerate is not the same as the channel settings, then it will be a big performance issue while playing?

Yes. What version/build of Caspar are you working with?

I can only run dxdiag, no diag on my computer…

Just type diag ENTER in the Caspar console window

tried 2.07 2.1 and last build

just tried 2160p2997 configuration, but no luck
this is as the same as the sample file is (res&framerate)