Giter VIP home page Giter VIP logo

Comments (4)

neilcsmith-net avatar neilcsmith-net commented on May 29, 2024

The library is a wrapper for GStreamer - it uses whatever threading is set up for the pipeline by the underlying native library, which is ultimately up to what you set up. While that might be single-threaded, it should not be running on the thread you call pipeline.play() on. However, some of the initialization of the pipeline might happen on the thread you call pipeline.play() on. Does that never return?

Please share some more of your code setup - it's impossible to guess what's happening here. Also, if your pipeline initialization is taking more time than you want, you can use Gst.invokeLater() or Gst.getScheduledExecutorService().

from gst1-java-core.

zilti avatar zilti commented on May 29, 2024

pipeline.play() always returns pretty much instantly. Though a glance at the task manager on KDE/Linux tells me that the whole Java process including GStreamer uses only one the sixteen physical threads (8 cores with SMT). Now what I did then was calling pipeline.play() in a new thread which made Java use two physical threads. What improved it further, though apparently not using more threads, was adding "used-cpu" option to the vp8enc pad.

According to the GStreamer documentation, GStreamer is supposedly "inherently multithreaded" and using queues supposedly forces more threads. So somewhere in between Java and GStreamer is something wrong, it seems, or I am doing it wrong, or the docs are "PR talk". Here's essentially my pipeline: http://lyrion.ch/share/pipeline.png (codecs have changed, and I added number of threads (without effect) and "used-cpu" to the video encoder)

from gst1-java-core.

neilcsmith-net avatar neilcsmith-net commented on May 29, 2024

I have to say the most likely answer is you're doing something wrong! There may be issues in the bindings but it's unlikely they would have any effect on threading. You can build a similar pipeline on the CLI with gst-launch and see if that behaves any differently.

I'm sceptical about some aspects of that pipeline - whether the layout is actually parallelizable and whether those queues are required.

I would try replicating some of the simpler multi-threaded examples from upstream and see how you get on. I would also follow up on the GStreamer mailing lists and check that pipeline.

I haven't used KDE for a long time, so not sure how useful the task manager is for actually seeing exactly what's going on here.

from gst1-java-core.

neilcsmith-net avatar neilcsmith-net commented on May 29, 2024

Not heard further on this so closing. Thanks.

from gst1-java-core.

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.