Making a simple pipeline

David Röthlisberger david at rothlis.net
Tue Aug 6 02:20:37 PDT 2013


On 6 Aug 2013, at 10:03, matt wrote:
> Hi,
> 
> This is what I want to do:
> 
> videotestsrc --> xvimagesink
> 
> I know it's very simple but I appear to be making a mistake somewhere in my code. Can someone please help? The code is below
> 
> *************************************************************************************************
> #!/usr/bin/python
> 
> import gobject;
> gobject.threads_init()
> import gst
> 
> # Above setup the imports
> 
> if __name__ == "__main__":
>  # First create our pipeline
>  pipe2 = gst.Pipeline("mypipe")
> 
>  s2 = gst.element_factory_make("xvimagesink", "screen")
>  print s2
>  vsrc = gst.element_factory_make("videotestsrc", "videosrc")
>  q1 = gst.element_factory_make("queue", "qu1")
> 
>  pipe2.add(vsrc, s2)
>  gst.element_link_many(vsrc, s2)
> 
>  videosrc=vsrc.get_pad('src')
>  print videosrc
>  sinkpad=s2.get_pad("sink")
>  print sinkpad
>  videosrc.link(sinkpad)
> 
>  pipe2.set_state(gst.STATE_PLAYING)


Do you really need to create & link each element individually? Try:

    pipe2 = gst.parse_launch("videotestsrc ! xvimagesink")
    pipe2.set_state(gst.STATE_PLAYING)



More information about the gstreamer-devel mailing list