0

I'm trying to replace playbin in an application with my own pipeline, because I need to add filters to the video. Here is what I tried:

#     self.pipeline = gst.ElementFactory.make("playbin", None)
#     self.pipeline.set_property("uri", "appsrc://")
self.pipeline = gst.Pipeline.new("player")
source = gst.ElementFactory.make("uridecodebin", "decodebin")
source.set_property("uri", "appsrc://")
self.pipeline.add(source)

aqueue = gst.ElementFactory.make("queue", "aqueue")        
aconverter = gst.ElementFactory.make("audioconvert", "aconverter")        
asink = gst.ElementFactory.make("autoaudiosink", "audiosink")
self.pipeline.add(aqueue)
self.pipeline.add(aconverter)
self.pipeline.add(asink)
source.link(aqueue)
aqueue.link(aconverter)
aconverter.link(asink)

vqueue = gst.ElementFactory.make("queue", "vqueue")        
vconverter = gst.ElementFactory.make("videoconvert", "vconverter")
vsink = gst.ElementFactory.make("autovideosink", "videosink")
self.pipeline.add(vqueue)
self.pipeline.add(vconverter)
self.pipeline.add(vsink)
source.link(vqueue)
vqueue.link(vconverter)
vconverter.link(vsink)

Later I connect to the source's source-setup signal, and then to the need-data signal to feed it with data. This works with playbin, i.e. an output window opens and shows the video. With my custom pipeline nothing happens - no window is opened and of course I can't see anything.

Why is that so and how can I fix it?

I have also tried removing all the audio stuff and using only the video elements, with the same result. I don't even really need audio for this application.

Christoph
  • 1,040
  • 3
  • 14
  • 29

1 Answers1

1

Uridecodebin has dynamic pads. They are only created when streaming starts because it needs to demux/decode to get to know how many pads it needs to expose. Check https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-pads.html#section-pads-dynamic

For debugging it is also good practice to look at the gstreamer logs or check the pipeline bus for error messages. It likely would have reported a not-linked error. Or checking the return for the link calls would tell you it was failing.

Anyway, you can just use playbin and set the video-filter property.

thiagoss
  • 2,034
  • 13
  • 8
  • Linking dynamically worked well, I see an output window now. Setting playbin properties didn't work yet though, but I'll try to do that as well just to see which way is more suitable for my application – Christoph Oct 09 '16 at 13:36
  • Check the debug logs to see if it helps understanding the issue with the property – thiagoss Oct 09 '16 at 15:21
  • the debug output says that there's no such property. I guess that should go into another question though. – Christoph Oct 10 '16 at 11:54