dturing / node-gstreamer-superficial

Superficial gstreamer binding
MIT License
127 stars 45 forks source link

How does one use the `autovideosink`? #35

Closed chrisspiegl closed 4 years ago

chrisspiegl commented 4 years ago

Hello, I am new to this library (and also pretty new to Gstreamer).

I am testing the examples to get a grasp, and thus far I noticed that it only works with node v12.11…

There the code runs seemingly without error, however, also without output?

I have tested gst-launch-1.0 videotestsrc ! autovideosink and a little window opens up to show me that videotestsrc however, if I do the same little piece of code with node-gstreamer-superficial, I don't get a window at all?

Any help would be appreciated.

P.S.: I am on macOS with node version 12.11.1 active for the testing.

dturing commented 4 years ago

Probably maybe, node quits the process. Try to keep your process active, e.g. with a setInterval. The following code works for me (nodejs 13.13 on linux):

var gstreamer = require('gstreamer-superficial');

const pipeline = new gstreamer.Pipeline('videotestsrc ! autovideosink');
pipeline.play()

setInterval(() => {}, 100)
chrisspiegl commented 4 years ago

That sounds about right. Thanks for the idea. In the mean time I noticed that gstreamer-superficial is not the package for me and I will just have to resort to using Python and the bindings there because I have to do interactions with the pipeline which I am not able to do with this package (or at least I could not figure it out).

Seems Gstreamer is more popular in the Python community — and even there it is under represented 🙈.

Thanks for this solution though and may it help someone in need 👍 .

dturing commented 4 years ago

Sure, the gstreamer python bindings are way more advanced (thanks to fluendo et al! :) I do hope nodejs someday gets a deeper (non-superficial) binding. This module is really just intended for some quick prototypes or proof-of-concept things. Thanks for feeding back, @chrisspiegl.