Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPU Usage #1

Open
tghanem opened this issue Sep 19, 2022 · 1 comment
Open

CPU Usage #1

tghanem opened this issue Sep 19, 2022 · 1 comment

Comments

@tghanem
Copy link

tghanem commented Sep 19, 2022

I am working on a media streaming client that streams two screens (1920x1080) and 1 camera (640x480).

I noticed that the Vpx encoder consumes a lot of CPU (~50%) which for me is reasonable because I have 3 video streams that are being encoded.

My question is: is there a way I can control the CPU utilization? I expect that the encoder might become significantly slower but at least a setting that will help me fine-tune it.

@sipsorcery
Copy link
Member

There are a few things you could try:

  • The VP8 codec has lots of options. You could check out the docs and try tweaking them in the codec initialiation method.

  • Reducing the frame rate and/or resolution is likely to have a BIG impact on CPU. I suspect you're already probably down to 5 fps, given you're using a 1080p stream, but if you can live with 1fps or less that would be a big reduction in CPU.

  • Last one is more of a warning rather than option. This library sacrifices performance for usability when it transfers video frames across the native to managed boundary. The cost of working with video frames in dotnet is high CPU. You might be able to reduce it a bit with options like the previous two, but eventually, if you need a greater reduction, the answer is C++.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants