GST-PYTHON custom plugin: "segment" field not writable

• Jetson Xavier NX
• DeepStream 6.1
• JetPack Version 5.0.1

I have written a gstreamer python plugin (gst-python) which works well on JetPack 4.6.1.
I want now to migrate to JP 5.0.1 and the same plugin gives me the following error:

Traceback (most recent call last):
  File "/home/.../", line 91, in event_func
    self.segment = segment
RuntimeError: field is not writable

The python plugin relevant code is:

class GstImgSnapShot(GstBase.BaseTransform):

    GST_PLUGIN_NAME = "save_image_snapshot"

    __gstmetadata__ = ("save-image-snapshot",  # Name
                       "Tool",   # Transform
                       "save-image-snapshot",  # Description
                       "...")  # Author

    # Here we define the pads
    __gsttemplates__ = ("src",
                                            # Set to RGB format
                                            # Set to RGB format

    # Here we define the possible parameters
    __gproperties__ = {
        "record-dict": (GObject.TYPE_PYOBJECT,  # type
                   "record_dict",  # nick
                   "record_dict",  # blurb
                   GObject.ParamFlags.READWRITE  # flags

    def __init__(self):
        # initialization function is called whenever the corresponding element is created in the application software
        super(GstImgSnapShot, self).__init__()

        # # set chain and event function on sinkpad
        self.sinkpads[0].set_chain_function_full(self.chain_function, None)
        self.sinkpads[0].set_event_function_full(self.event_func, None)

        self.record_dict = {"do_record":False}

    def do_get_property(self, prop: GObject.GParamSpec):
        # getter function for the properties
        raise NotImplementedError('Not implemented')

    def do_set_property(self, prop: GObject.GParamSpec, setting_json):
        # setter function for the properties
        if == 'record-dict':
            self.record_dict = setting_json
            raise AttributeError('unknown property %s' %

    def event_func(self, pad, parent, event):
        # event function handling events on sinkpad

        if event.type == Gst.EventType.CAPS:
            # get the frame resolution from the caps
            caps_structure = event.parse_caps().get_structure(0)
            self.resolution = (caps_structure.get_value("height"), caps_structure.get_value("width"))

            ret = self.srcpads[0].push_event (event)
        if event.type == Gst.EventType.SEGMENT:
            ret = pad.event_default (parent, event)
            segment = event.parse_segment()
            self.segment = segment # <----- the error seems to be here!
            ret = pad.event_default (parent, event)
        return ret

The plugin inherits from GstBaseTransform which does have the segment property but I do not know why it is not set as writable.

Any help is very much appreciated.

From JP 4.6.1 tp JP 5.0.1, we have update the Gstreamer from 1.14.5 to 1.16.2. It looks like an Gstreamer gst-python problem. You can ask this in the Gstreamer Forum. Thanks

Thanks @yuweiw, do you mean that there is a Gstreamer forum here or is it a different website? If so, could you provide me with a link to the forum?


There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

You can report bugs on the official website of Gstreamer.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.