How can I create a mosaic in Gstreamer? How can I set "sink_0::xpos=0 sink_0::ypos=0 sink_0::alpha=0" in Python?

Giacomo D omagico.olo at gmail.com
Sat Aug 1 10:25:38 PDT 2015


1.  I am needing help converting the script below in bold into Python.  I
have tried but without success and can't find any help on the Internet. 
Does someone have experience in this?

gst-launch-1.0 -e \
videomixer name=mix \
*        sink_0::xpos=0   sink_0::ypos=0  sink_0::alpha=0\
        sink_1::xpos=0   sink_1::ypos=0 \
        sink_2::xpos=200 sink_2::ypos=0 \
        sink_3::xpos=0   sink_3::ypos=100 \
        sink_4::xpos=200 sink_4::ypos=100 \*
    ! xvimagesink \
videotestsrc pattern="black" \
    ! video/x-raw,width=400,height=200 \
    ! mix.sink_0 \
uridecodebin
uri='file:///home/giacomo/Scrivania/Sam_Smith_-_Im_Not_The_Only_One.avi' \
    ! videoconvert ! videoscale \
    ! video/x-raw,width=200,height=100 \
    ! mix.sink_1 \
uridecodebin
uri='file:///home/giacomo/Scrivania/Sam_Smith_-_Im_Not_The_Only_One.avi' \
    ! videoconvert ! videoscale \
    ! video/x-raw,width=200,height=100 \
    ! mix.sink_2 \
uridecodebin
uri='file:///home/giacomo/Scrivania/Sam_Smith_-_Im_Not_The_Only_One.avi' \
    ! videoconvert ! videoscale \
    ! video/x-raw,width=200,height=100 \
    ! mix.sink_3 \
uridecodebin
uri='file:///home/giacomo/Scrivania/Sam_Smith_-_Im_Not_The_Only_One.avi' \
    ! videoconvert ! videoscale \
    ! video/x-raw,width=200,height=100 \
    ! mix.sink_4 \



2. From what I already know about Python, I tried with the converted script
below but get the following error:  "AttributeError: 'NoneType' object has
no attribute 'set_property'"

       self.pad0 = self.videomixer.get_static_pad("sink_0")
       self.pad1 = self.videomixer.get_static_pad("sink_1")
       self.pad2 = self.videomixer.get_static_pad("sink_2")
       self.pad3 = self.videomixer.get_static_pad("sink_3")
       self.pad4 = self.videomixer.get_static_pad("sink_4")


       #sink_0
       self.pad0.set_property('xpos',0)
       self.pad0.set_property("ypos",0)
       self.pad0.set_property("alpha",0)

       #sink_1
       self.pad1.set_property("xpos",0)
       self.pad1.set_property("ypos",0)

       #sink_2
       self.pad2.set_property("xpos",200)
       self.pad2.set_property("ypos",0)

       #sink_3
       self.pad2.set_property("xpos",0)
       self.pad2.set_property("ypos",100)

       #sink_4
       self.pad2.set_property("xpos",200)
       self.pad2.set_property("ypos",100)














--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-can-I-create-a-mosaic-in-Gstreamer-How-can-I-set-sink-0-xpos-0-sink-0-ypos-0-sink-0-alpha-0-in-P-tp4672943.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list