Comments (4)
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.
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.
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.
Not heard further on this so closing. Thanks.
from gst1-java-core.
Related Issues (20)
- How to add an external binding to a native gstreamer function ? HOT 5
- get() on WebRTCBin causes java.lang.InstantiationException HOT 6
- Question about multithreading with multiple pipelines. HOT 1
- Possible crash on async explicit dispose in 1.4.0 HOT 3
- How to load subtitles? Solution and example required.
- native memory still exists after Pipeline.close HOT 6
- Is it possible to have a custom thread pool to execute GstCallback (AppSink.connect) ? (question)
- How to receive each frame as its pointer(Long type) or Byte array or etc. HOT 1
- VAAPI invalid chip id or driver is being used. HOT 2
- Using GIO objects
- GType.valueOf(long) is not thead safe HOT 3
- JVM Crashes HOT 3
- What may be the reason why the pipeline cannot be created HOT 2
- Exception in thread "main" java.lang.Error: Invalid memory access HOT 2
- How to improve throughput
- WebRTCBin.createAnswer() callback not called sporadically (promise garbage collected) HOT 4
- No such Gstreamer factory: webrtcbin HOT 5
- How to get RTPSession from rtpbin
- Need to know the native pointer of a Buffer object
- Segfault in extractError function HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gst1-java-core.