问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/12055018/scheduled-pause-in-gnonlin