How to change element properties dynamically in python-gstreamer ?

vk_gst venkateshkuppan26 at gmail.com
Fri Aug 3 16:05:11 UTC 2018


Hello,

I am using python bindings for Gstreamer, and trying to utilize the element
'gltransformation' for some video effects. The basic pipeline is as follows
: 
gltestsrc -> gltransformation -> glimagesink

Here is a snippet from the python code:

#global variables
#the values of a,b,c get updated for certain events dynamically
a = 0
b= 0
c = 0


source = Gst.ElementFactory.make("gltestsrc", "source")
gltrnsfrm = Gst.ElementFactory.make("gltransformation","gltrnsfrm")
sink = Gst.ElementFactory.make("glimagesink", "sink")

# create the empty pipeline
pipeline = Gst.Pipeline.new("test-pipeline")

if not pipeline or not source or not gltrnsfrm or not sink:
    print("ERROR: Not all elements could be created")
    sys.exit(1)

# build the pipeline
pipeline.add(source,gltrnsfrm,sink)

if not source.link(gltrnsfrm):
    print("ERROR: Could not link source to gltrsnfrm")
    sys.exit(1)

if not gltrnsfrm.link(sink):
   print("ERROR: Could not link gltrsnfrm  to sink")
   sys.exit(1)

# modify the gltransformation's properties
gltrnsfrm.set_property("rotation-z",a)
gltrnsfrm.set_property("rotation-x",b)
gltrnsfrm.set_property("rotation-y",c)


Now I understand that the values of a,b,c are set in the initial moment and
then later on, there are no updates to the properties. I read about using
Gstcontrol sources, however, I am not sure on the syntax and its usage in
python. 

Does anyone have a hand on this problem?? 

Regards




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list