Closed hamza-u closed 4 years ago
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 ..
- Tried with 320x240 @ 10fps - google.com, still it's 10% load
I assume you meant 100 % here :)
- gstreamer version is 1.14.5
OK, I'm trying with gst-build / master, please set that up on your end and report results
- 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 ;)
Perhaps you can learn more with a profiling program, eg gprof
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.
Interesting, but please try with latest gstreamer: https://gitlab.freedesktop.org/gstreamer/gst-build
Also @hamza-u please paste the pipeline you're trying
Sure i will try with latest gstreamer.
pipeline used : cefsrc ! videoconvert ! fakesink sync=true async=false Also tried with xvimagesink.
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.
@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.
@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.
ok then :)
gst-launch process uses 100% cpu load even on loading an empty html page.