我如何使用 gstreamer & smpte 使用 gst-launch 连接 2 个视频文件?
我有 2 个视频文件(vid1.mov 和 vid2.mov),两者具有相同的帧大小和帧速率。我想要 1 个最终视频,依次显示 vid1.mov 和 vid2.mov。我还希望有从一个视频到另一个视频的过渡(而不是视频的突然变化),并且发现了 gstreamer 的 smpte 插件,这正是我想要的。
在 ubuntu linux 命令行上使用 gst-launch
,如何将 2 个视频与转场合并在一起?
(假设我想使用与 2 秒长且 type=234 的 smpte 示例中相同的转换)
我尝试像这样修改 smpte 示例:
gst-launch filesrc location=vid1.mov ! decodebin ! ffmpegcolorspace ! smpte name=s border=20000 type=234 duration=2000000000 ! ffmpegcolorspace ! ximagesink filesrc location=vid2.MOV ! decodebin ! ffmpegcolorspace ! s.
它开始同时播放两个视频,然后从一个视频转换到另一个视频,所以它只显示 vid1.mov 的 2 秒,然后播放所有 vid2.mov。我怎样才能让它播放所有的vid1.mov,然后在vid1.mov结束前2秒,它开始播放vid2.mov,并开始转换,这样它就在vid1.mov结束时完成转换,然后它应该继续播放所有内容vid2.mov 正常。
I have 2 video files (vid1.mov and vid2.mov), both have the same frame size and frame rate. I want to have 1 final video with shows vid1.mov and then vid2.mov, one after the other. I also want there to be a transition from one video to another (rather than an abrupt change of video), and have discovered the smpte plugin for gstreamer, which goes what I want.
Using gst-launch
on the ubuntu linux command line, how can I merge the 2 videos together with a transition?
(Assume I want to use the same transition as in the smpte example of 2 seconds long and type=234)
I tried modifying the smpte example like this:
gst-launch filesrc location=vid1.mov ! decodebin ! ffmpegcolorspace ! smpte name=s border=20000 type=234 duration=2000000000 ! ffmpegcolorspace ! ximagesink filesrc location=vid2.MOV ! decodebin ! ffmpegcolorspace ! s.
It starts playing both videos at the same time, then transitioning from one to the other, so it only shows 2sec of vid1.mov, and then plays all of vid2.mov. How can I get it play all of vid1.mov, then 2sec before vid1.mov ends, it starts playing vid2.mov, and starts transitioning, so that it finishs transitioning just as vid1.mov ends, it should then continue to play all of vid2.mov as normal.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
其他人向我指出了 GNonLin,用于 gstreamer 非线性编辑的东西,它将与此一起使用。不过我还有其他问题。 使用 GStreamer 进行视频转场GNonLin 不工作
Someone else has pointed me to GNonLin, for gstreamer non-linear editing stuff, which would be used with this. However I have other problems with it cf. Video Transitions with GStreamer & GNonLin not working