How to add properties to "videoconvert" element using Gst.Pipeline

691 views Asked by At

I am tring to write a gstreamer pipeline using Gst.Pipeline(). The problem is that I can't figure out how to convert "string" pipeline to gst.pipeline, how to add properties to the videoconvert element?

for example for a pipeline like this: **<some src...>** ! videoconvert ! video/x-raw,format=I420 ! **<some enc...>** I dont undewrstand how to set the propety video/x-raw,format=I420 for the videoconvert ElementFactory

I tried this but its not working..

convert = Gst.ElementFactory.make("videoconvert", "convert")
caps_str = "video/x-raw,format=I420"
caps = Gst.Caps.from_string(caps_str)
convert.set_property("caps", caps)

I get this error message:

TypeError: object of type `GstVideoConvert' does not have property 'caps'
1

There are 1 answers

0
Thảo Dương On

Of course, the plugin videoconvert doesn't have the property "caps". The correct way is

convert = Gst.ElementFactory.make("videoconvert", "convert")
capsfilter = Gst.ElementFactory.make("capsfilter", "capsfilter")
caps_str = "video/x-raw,format=I420"
caps = Gst.Caps.from_string(caps_str)
capsfilter.set_property("caps", caps)

The element convert will link to capsfilter.