How can I use gstreamer & smpte to concatenate 2 video files with gst-launch?

江枫思渺然 提交于 2019-12-24 20:26:27

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/6753998/how-can-i-use-gstreamer-smpte-to-concatenate-2-video-files-with-gst-launch

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