@@ -0,0 +1,1890 @@
+#!/usr/bin/python3%0A%0Aimport sys%0Aimport gi%0Agi.require_version('Gst', '1.0')%0Afrom gi.repository import GObject, Gst%0A%0Adef bus_call(bus, msg, *args):%0A    # print(%22BUSCALL%22, msg, msg.type, *args)%0A    if msg.type == Gst.MessageType.EOS:%0A        print(%22End-of-stream%22)%0A        loop.quit()%0A        return%0A    elif msg.type == Gst.MessageType.ERROR:%0A        print(%22GST ERROR%22, msg.parse_error())%0A        loop.quit()%0A        return%0A    return True%0A%0Asaturation = -100%0Adef set_saturation(pipeline):%0A    global saturation%0A    if saturation %3C= 100:%0A      print(%22Setting saturation to %7B0%7D%22.format(saturation))%0A      videosrc.set_property(%22saturation%22, saturation)%0A      videosrc.set_property(%22annotation-text%22, %22Saturation %25d%22 %25 (saturation))%0A    else:%0A      pipeline.send_event (Gst.Event.new_eos())%0A      return False%0A    saturation += 10%0A    return True%0A%0A%0Aif __name__ == %22__main__%22:%0A    GObject.threads_init()%0A    # initialization%0A    loop = GObject.MainLoop()%0A    Gst.init(None)%0A%0A    pipeline = Gst.parse_launch (%22rpicamsrc name=src ! video/x-h264,width=320,height=240 ! h264parse ! mp4mux ! filesink name=s%22)%0A    if pipeline == None:%0A      print (%22Failed to create pipeline%22)%0A      sys.exit(0)%0A%0A    # watch for messages on the pipeline's bus (note that this will only%0A    # work like this when a GLib main loop is running)%0A    bus = pipeline.get_bus()%0A    bus.add_watch(0, bus_call, loop)%0A%0A    videosrc = pipeline.get_by_name (%22src%22)%0A    videosrc.set_property(%22saturation%22, saturation)%0A    videosrc.set_property(%22annotation-mode%22, 1)%0A%0A    sink = pipeline.get_by_name (%22s%22)%0A    sink.set_property (%22location%22, %22test.mp4%22)%0A%0A    # this will call set_saturation every 1s%0A    GObject.timeout_add(1000, set_saturation, pipeline)%0A%0A    # run%0A    pipeline.set_state(Gst.State.PLAYING)%0A    try:%0A        loop.run()%0A    except Exception as e:%0A        print(e)%0A    # cleanup%0A    pipeline.set_state(Gst.State.NULL)%0A%0A

Add dynamic properties example