Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scheduled pause in Gnonlin

I am using Gnonlin to play two videos. At one moment, I would like to pause one video and run another. However, I don't want to manually pause the pipeline, as the other video also will be paused.

For example:

self.video[0].set_property("location", LOCATION_VIDEO1)
self.video[0].set_property("start", 0 * gst.SECOND)
self.video[0].set_property("duration", 5 * gst.SECOND)
self.video[0].set_property("media-start", 0 * gst.SECOND)
self.video[0].set_property("media-duration", 5 * gst.SECOND)

This video runs for five seconds. What can I do to pause it or stop playing this video for the next five seconds? Is there a way to show the same frame for five seconds?

like image 305
Thothadri Rajesh Avatar asked Aug 21 '12 12:08

Thothadri Rajesh


1 Answers

Based on this article http://www.jonobacon.com/2006/12/27/using-gnonlin-with-gstreamer-and-python/, if I'm understanding it right, I think you can write:

self.video[0].set_property("location", LOCATION_VIDEO1)
self.video[0].set_property("start", 0 * gst.SECOND)
self.video[0].set_property("duration", 5 * gst.SECOND)
self.video[0].set_property("media-start", 0 * gst.SECOND)
self.video[0].set_property("media-duration", 0 * gst.SECOND)

To get a frozen frame for 5 seconds. It may work for you...alternatively this may work:

self._playbin.set_state(gst.STATE_PAUSED) 

Other than that, I have no suggestions - documentation seems sparse. If you could point me to an API I may have a better idea.

like image 101
jimh Avatar answered Nov 27 '22 16:11

jimh