【问题标题】:gstreamer command to compose (pip) two videosgstreamer 命令组合(pip)两个视频
【发布时间】:2011-04-25 00:16:23
【问题描述】:

我应该在 gstreamer 中执行什么命令才能将两个 320x240 视频组合成一个 640x240 并排视频?

假设我有 video1.avi 和 video2.avi

【问题讨论】:

  • 这是可能的,我已经做到了,但是我最后一次尝试得到的帧速率非常错误且缓慢。也许有人可以解释一下。祝你好运。
  • 谢谢,还有其他方法,我可以在服务器端使用什么来编写/编辑视频吗?

标签: video video-processing gstreamer video-editing


【解决方案1】:

videomixer 插件来救援:

gst-launch -v \
filesrc location=video1.avi ! avidemux name=demux1 \
filesrc location=video2.avi ! avidemux name=demux2 \
videomixer name=mix \
        sink_0::xpos=0   sink_0::ypos=0 sink_0::alpha=0 \
        sink_1::xpos=0   sink_1::ypos=0 \
        sink_2::xpos=320 sink_2::ypos=0 \
    ! xvimagesink \
videotestsrc pattern="black" \
    ! video/x-raw-yuv,width=640,height=240 \
    ! mix.sink_0 \
demux1.video_00 \
    ! queue ! decodebin ! ffmpegcolorspace ! videoscale \
    ! video/x-raw-yuv,width=320,height=240 \
    ! mix.sink_1 \
demux2.video_00 \
    ! queue ! decodebin ! ffmpegcolorspace ! videoscale \
    ! video/x-raw-yuv,width=320,height=240 \
    ! mix.sink_2 \

【讨论】:

  • 这是一个很好的答案。如果使用uridecodebin 而不是filesrc 如何引用文件?我还需要设置一个变量名吗,如果需要怎么办?
  • 是的,我认为没有name 也可以完成这项工作:只需删除带有filesrc ... 的行并将demuxX.video00 ! queue ! decodebin 替换为urldecodebin
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-08-13
  • 1970-01-01
  • 2014-08-15
  • 1970-01-01
  • 2012-05-30
  • 2021-12-25
相关资源
最近更新 更多