在视频中创建片段

发布于 2024-12-05 02:43:38 字数 563 浏览 0 评论 0原文

我使用的是 Python 2.7、PyGTK 2.24 和 PyGST (Gstreamer)。

为了确保从一个剪辑到另一个剪辑的流畅播放(不眨眼),我将所需的所有剪辑组合成一个更大的视频。这让我可以在代码中找到我需要的确切位置。其中一个剪辑就像一个“填充”,只要其他剪辑之一不播放,它就会循环播放。

但是,为了使我的代码更简单、更精简,我想使用片段来定义较大视频中的各种剪辑。然后,在每个片段的末尾(我知道有一个片段结束事件),我寻找填充剪辑。当我需要另一个剪辑时,我只需寻找该片段即可。

我的问题是,我到底如何创建这些片段?我猜那将是 event_new_new_segment(),但我不确定。我可以创建多个剪辑来使用此功能进行搜索吗?还有其他我应该使用的吗?在我的视频中进行这种搜索方法是否有任何我应该注意的问题?

其次,我如何寻找该细分市场?

谢谢你!

I'm using Python 2.7, PyGTK 2.24, and PyGST (Gstreamer).

To ensure smooth playback from one clip to another (without a blink), I combined all the clips I needed into one larger video. This lets me seek to the exact place I need in code. One of the clips is like a "fill-in", which should loop whenever one of the other clips is not playing.

However, to make my code easier and more streamlined, I want to use segments to define the various clips within the larger video. Then, at the end of each segment (I know there is a segment end event), I seek to the fill-in clip. When I need another clip, I just seek to that segment.

My question is, how exactly do I create these segments? I'm guessing that would be the event_new_new_segment(), but I am not sure. Can I create multiple clips to seek with using this function? Is there another I should use. Are there any gotchas to this method of seeking in my video that I should be aware of?

Second, how do I seek to that segement?

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

避讳 2024-12-12 02:43:38

看起来只有 GstElement 可以生成 NEWSEGMENT 事件,您不能简单地将其附加到现有元素。如果不使用Python,您可以做的最接近的事情是创建一个 单次拍摄周期性 GstClockID 或并使用 gst_clock_id_wait_async< /code>直到时钟时间到。但问题是,GstClockID 未包含 PyGst。

我想我实际上正在解决一些类似的问题。我现在使用的某种解决方案是使用 gnonlin 实时粘合视频流。好的一面:似乎有效,但还没有时间彻底测试它。不好的一面:文档不完整且有问题。 这些来源来自flumotion< /code> 项目(以及里面的注释!)对于我理解如何使整个事情正常工作非常非常有帮助。

Looks like only GstElement's can generate NEWSEGMENT events, you can't simply attach it to an existing element. The closest thing you could do if not using Python, would be creating a single shot or periodic GstClockID or and use gst_clock_id_wait_async until the clock time hit. But the problem is, GstClockID is not wrapped in PyGst.

I think I'm actually working on some similar problem. Some kind of solution I'm using now, is gluing video streams in real time with gnonlin. The good side: seems to work, didn't have time to thoroughly test it yet. Bad side: poorly documented and buggy. These sources from the flumotion project (and the comments inside!) were very, very helpful to me for understanding how to make the whole thing work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文