I am developing video chat using gst and python. where, I would like to view end user's webcam and also want to view my own webcam in one gtk window (similar to empathy video chat).
for that, I have used gst.Tee object and created 2 queues, one would link result to local gtk window and second queue would link same video stream to session object.
gst.Tee have done the task but also decrease the speed of video chat and Video comes later than Audio. (I have used different stream for Audio session)
here, the code snippet :
self.pipeline = gst.Pipeline()
bus = self.pipeline.get_bus()
bus.add_signal_watch()
bus.connect('message', self._on_gst_message)
self.src_bin = gst.element_factory_make("autovideosrc", "src")
autovideosinkLocal = gst.element_factory_make("autovideosink", "autovideosinkLocal")
tee = gst.element_factory_make('tee', "tee")
queueLocal = gst.element_factory_make("queue", "queueLocal")
queueSend = gst.element_factory_make("queue", "queueSend")
self.pipeline.add(self.src_bin, tee, queueLocal, autovideosinkLocal, queueSend)
gst.element_link_many(self.src_bin, tee)
tee.link(queueLocal)
queueLocal.link(autovideosinkLocal)
tee.link(queueSend)
queueSend.get_pad('src').link(self.p2psession.get_property('sink-pad'))
self.pipeline.set_state(gst.STATE_PLAYING)
How would I speedup the video chat (like, If I would use single sink and display only accepter's video it works great)?
Is there any other way to do the same?
Thanks!