GithubHelp home page GithubHelp logo

Comments (12)

MathieuDuponchelle avatar MathieuDuponchelle commented on June 8, 2024

CEF is pretty demanding, however I can't reproduce this here:

GST_PLUGIN_PATH=$PWD/Release:$GST_PLUGIN_PATH gst-launch-1.0 cefsrc url="https://google.com" ! queue ! cefdemux name=d   d.video ! video/x-raw ! queue ! videoconvert ! autovideosink

shows around 55 % CPU usage on my machine, with single-core load not exceeding 40 % .

The default resolution is 1920 x 1080, and lowering that to eg 640 x 480:

GST_PLUGIN_PATH=$PWD/Release:$GST_PLUGIN_PATH gst-launch-1.0 cefsrc url="https://google.com" ! video/x-raw, width=640, height=480 ! queue ! cefdemux name=d   d.video ! video/x-raw ! queue ! videoconvert ! autovideosink

does show a corresponding decrease in CPU usage (20 %, single core not exceeding 10 %).

More precisions will be needed to debug this, eg what hardware are you running this on, does CPU usage decrease if you lower the resolution, gstreamer version, etc ..

from gstcefsrc.

hamza-u avatar hamza-u commented on June 8, 2024
  1. Tried with 320x240 @ 10fps - google.com, still it's 10% load
  2. gstreamer version is 1.14.5
  3. Regardless of hardware it takes 100% of one core, tried on laptpo, Intel E3v4 server, aws c5 instances too.
  4. When i wrtoe a simple CEF app without gstreamer there i do not see this issue.
  5. I'm suspecting something is going wrong as CEF & Gstreamer both use glib event loop.

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on June 8, 2024
  1. Tried with 320x240 @ 10fps - google.com, still it's 10% load

I assume you meant 100 % here :)

  1. gstreamer version is 1.14.5

OK, I'm trying with gst-build / master, please set that up on your end and report results

  1. I'm suspecting something is going wrong as CEF & Gstreamer both use glib event loop.

Usage of GMainLoop in and of itself isn't known to cause such issues ;)

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on June 8, 2024

Perhaps you can learn more with a profiling program, eg gprof

from gstcefsrc.

hamza-u avatar hamza-u commented on June 8, 2024

On replacing g_main_loop_run() from gstreamer app with while (true) sleep() and adding CefRunMessageLoop(); instead of CefDoMessageLoopWork (); in cefsrc plugin, 100% CPU load issue went away.

But obviously this is not a correct solution as event handling in gstreamer app is broken.

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on June 8, 2024

Interesting, but please try with latest gstreamer: https://gitlab.freedesktop.org/gstreamer/gst-build

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on June 8, 2024

Also @hamza-u please paste the pipeline you're trying

from gstcefsrc.

hamza-u avatar hamza-u commented on June 8, 2024

Sure i will try with latest gstreamer.

pipeline used : cefsrc ! videoconvert ! fakesink sync=true async=false
Also tried with xvimagesink.

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on June 8, 2024

OK.

On my end:

GST_PLUGIN_PATH=$PWD/Release:$GST_PLUGIN_PATH gst-launch-1.0 cefsrc url="www.google.com" ! videoconvert ! fakesink sync=true async=false

CPU usage sits at 11 % :)

I assume you haven't modified the default CEF version downloaded by the build system?

In any case, definitely try with master gst-build, and ideally obtain profiling data with gprof.

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on June 8, 2024

@hamza-u to keep things tidy I will close this as I haven't had an answer to my last question, please reopen if you have more information.

from gstcefsrc.

hamza-u avatar hamza-u commented on June 8, 2024

@MathieuDuponchelle , sorry for delayed response, i was using CEF version 76.1.13+gf19c584+chromium-76.0.3809.132, on using same version as yours 3.3440.1806.g65046b7 i do not see high cpu usage issue.

from gstcefsrc.

MathieuDuponchelle avatar MathieuDuponchelle commented on June 8, 2024

ok then :)

from gstcefsrc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.