Scheduled pause in Gnonlin

房东的猫 提交于 2019-12-21 06:48:59

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!