In my setup
glshader
element produce internal data stream error after playing->null->playing
but any other gl element, like gleffects_blur
works fine.
Code that cause that problem sample:
import gi
gi.require_version('Gst', '1.0')
from time import sleep
from gi.repository import Gst, GLib
Gst.init(None)
pipeline = Gst.Pipeline.new()
source = Gst.ElementFactory.make("videotestsrc")
glupload = Gst.ElementFactory.make("glupload")
glshader = Gst.ElementFactory.make("glshader")
sink = Gst.ElementFactory.make("glimagesink")
for i in [source, glupload, glshader, sink]:
pipeline.add(i)
source.link(glupload)
glupload.link(glshader)
glshader.link(sink)
def on_message(bus, message):
message_type = message.type
if message_type == Gst.MessageType.EOS:
print("End of stream reached.")
elif message_type == Gst.MessageType.ERROR:
err, debug = message.parse_error()
print(f"Error: {err}, Debug info: {debug}")
bus = pipeline.get_bus()
bus.add_signal_watch()
bus.connect("message", on_message)
def restart_pipeline():
print("Restarting pipeline...")
pipeline.set_state(Gst.State.NULL)
pipeline.set_state(Gst.State.PLAYING)
GLib.timeout_add_seconds(2, restart_pipeline)
pipeline.set_state(Gst.State.PLAYING)
loop = GLib.MainLoop()
loop.run()
This code starts pipeline and restarts pipeline after 2 secconds.
But pipeline restart doesn’t work:
Restarting pipeline...
Error: gst-stream-error-quark: Internal data stream error. (1), Debug info: ../gstreamer/subprojects/gstreamer/libs/gst/base/gstbasesrc.c(3187): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason error (-5)
With gleffects_blur
or other gl effect pipeline restart works fine
Issue link