dturing / node-gstreamer-superficial

Superficial gstreamer binding
MIT License
127 stars 45 forks source link

featurerequest #42

Closed infantilo closed 3 years ago

infantilo commented 3 years ago

It would be great to have the following functions built in superficial:

.) list all open gstreamer pipelines .) close/kill a pipeline (by name)

Many thanks for all your work and time you spent in this projekt. Its great!

dturing commented 3 years ago

Thanks for your input, but this is not how gstreamer works. While you can set a name on any element (and thus also on a pipeline), there is no global query-by-name function.

You can easily store all your pipelines in a dictionary and add the requested functionality in nodejs. node-gstreamer-superficial's purpose is to wrap gstreamer, not extend it.

infantilo commented 3 years ago

Thanks for reply, i've got the point of not extending gstreamer, but creating pipelines in node and closing node (unexpected/uncontrolled) leaves the created pipelines open. so it would be very useful to have an way to close or find them on restart of application. Maybe i'm missing something on how to do so?

dturing commented 3 years ago

If your pipelines are still running, it means the node process that started them is also still running. GStreamer has no way to start pipelines system-wide. Killing the node process should definitely kill all associated gst pipelines.

To regularly stop pipelines, use .stop(). They should be cleaned up (playing or stopped) when the garbage collector hits (i.e. you keep no more references to the pipeline).