Closed nazar-pc closed 3 years ago
That's probably a CEF / chromium issue. I can't reproduce this with the master branch, the default CEF build and the latest version of gstreamer (in the gst-build devenv). Can you provide more information wrt OS / whether you can reproduce the issue with the example pipeline / whether you've modified your local checkout of gstcefsrc or use your own CEF build?
I'm using Docker for development and I can confirm that gst-launch command from readme indeed works fine.
I've simplified it to this since I only care about video for now:
gst-launch-1.0 cefsrc url="https://soundcloud.com/platform/sama" ! queue ! cefdemux ! queue ! videoconvert ! autovideosink
Then I've tried to make reduced example, starting with above pipeline created programmatically, but it only shows black screen:
It seems to be literally the same thing.
Once I have that not showing black screen, I should be able to reduce my use case to a smaller demo. I'm using Rust, so getting segfaults is not quite what I expect :slightly_smiling_face:
You can reproduce my current environment by using this Dockerfile:
It uses the image I've built from here (which will have docs and stuff later): https://github.com/restreamio/docker-gstreamer
Build it with docker build -t gstcefsrc-test .
.
Then you should be able to to use even your X session with it (Dockerfile above assumes you have user ID 1000 in Linux):
docker run --rm -it --net host -v /run:/run gstcefsrc-test
After that it should work (may occasionally fail with X errors, but most of the time it works fine).
UPD: OS is Ubuntu 19.10 and packages are as shipped in the repos except GStreamer, its plugins and libnice that are built from source.
I'm using Rust, so getting segfaults is not quite what I expect :slightly_smiling_face:
There's https://github.com/servo/servo/tree/master/ports/gstplugin btw, which is a (more-or-less) pure Rust version of a browser source plugin based on Servo. If you feel like trying it :) It's probably not mature enough yet, but might be fun to try.
Hey @nazar-pc , the difference between your application and gst-launch is the lack of a GMainLoop. cefsrc uses https://magpcss.org/ceforum/apidocs3/projects/(default)/(_globals).html#CefDoMessageLoopWork() , which is non-blocking but must be called from the main thread of the application, so the source uses g_timeout_add to do so. Without a main loop around, the timeout never gets triggered, hence the black screen.
I can't remember the exact reason why I didn't use CefRunMessageLoop()
at the time but I could look into that, in the meantime you can work around this by running a main loop in your test application, instead of blocking on bus pops.
I've tried Webkit WPE-based plugin first, but it requires EGL which was not available in my case, so I decided to try this one. I've seen that Servo has something that looks like a plugin, but it is not on crates.io from what I've seen, so probably not very usable. I'll probably give it a try later though.
I'll try to run the main loop and let you know how it goes.
@nazar-pc , any news on that?
Not yet, I was busy with other things, will get back to this as soon as I can
OK, with this modification it runs indeed:
Will work on reduced example now.
Hm.. there is something weird going on. I'm not getting segfaults on this machine after a few hours trying. This machine is strange though. It reproduces other errors and warnings that the machine I had that segfault on didn't, probably because I'm running Ubuntu daily here.
I'll have to test again on the other machine where I got this segfault initially, probably tomorrow. Though it doesn't make any sense to me since it runs inside of a container...
After some investigation, I found that I can reproduce a similar crash when cefsrc is built in Debug mode. The initial issue is fixed by setting locales_dir_path
as such (hardcoded):
CefString(&settings.locales_dir_path).FromASCII("/home/meh/devel/gst-build/sandbox/gstcefsrc/build/Debug/locales");
There are however subsequent issues on shutdown. Some refactoring would be needed to address those, this will probably be best done when lifting the main loop requirement, as these tie in to the element's lifecycle as well.
@nazar-pc , can you confirm you were seeing the issue with a Debug build?
Yes, that is the difference! I was building it in Debug mode when it crashed and then spent 3 hours trying to find out why it doesn't crash in Release build yesterday.
I've tried Webkit WPE-based plugin first, but it requires EGL which was not available in my case, so I decided to try this one.
This requirement is optional now, you need gst 1.17, wpebackend-fdo git master (upcoming 1.8.x) though. To use swrast, set LIBGL_ALWAYS_SOFTWARE=true
at runtime.
you need gst 1.17
Was the change actually merged to master though? https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1267 is still open.
Yes it was. This MR is mostly about CI, I should rebase it at some point :)
As of the latest commit, cefsrc is usable in Debug mode, including at program destruction :)
I'm using GStreamer from Git as of right now and trying to use this to render a web page.
Relevant part of pipeline looks like
cefsrc -> cefdemux -> queue -> videoconvert
just like in the readme.However, for me it crashes like this:
Is this an issue in gstcefsrc, gstreamer or chromium itself?