尝试在 Gstreamer 中同时播放多个视频文件
我正在尝试为 gstreamer 创建一个命令,以便它可以同时播放多个视频文件。所以我做了一些研究,发现了这个
gst-launch -e videomixer name=mix ! ffmpegcolorspace ! xvimagesink \
videotestsrc pattern=1 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! \
videobox border-alpha=0 top=0 left=0 ! mix. \
videotestsrc pattern=15 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! \
videobox border-alpha=0 top=0 left=-320 ! mix. \
videotestsrc pattern=13 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! \
videobox border-alpha=0 top=-180 left=0 ! mix. \
videotestsrc pattern=0 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! \
videobox border-alpha=0 top=-180 left=-320 ! mix. \
videotestsrc pattern=3 ! video/x-raw-yuv, framerate=5/1, width=640, height=360 ! mix.
这是输出图像= https://i.sstatic.net/ 4lZWL.png
这是我修改的代码,应该是这样的
https://i.sstatic.net/Mdsc0.png
time gst-launch -e videomixer name=mix ! ffmpegcolorspace ! xvimagesink \
filesrc location=./Cityscape1Min_720p_mp4.mp4 ! video/x-raw-yuv, framerate=5/1, \
width=320, height=180 ! videobox border-alpha=0 top=0 left=0 ! mix. \
filesrc location=./Cityscape1Min_720p_mp4.mp4 ! video/x-raw-yuv, framerate=5/1, \
width=320, height=180 ! videobox border-alpha=0 top=0 left=-320 ! mix. \
filesrc location=./Cityscape1Min_720p_mp4.mp4 ! video/x-raw-yuv, framerate=5/1, \
width=320, height=180 ! videobox border-alpha=0 top=-180 left=0 ! mix. \
filesrc location=./Cityscape1Min_720p_mp4.mp4 ! video/x-raw-yuv, framerate=5/1, \
width=320, height=180 ! videobox border-alpha=0 top=-180 left=-320 ! mix.
但它不起作用。有人有其他解决方案吗?
Im trying to make a command for gstreamer so it can play multiple video files simultaneously. So I done some research and found this one
gst-launch -e videomixer name=mix ! ffmpegcolorspace ! xvimagesink \
videotestsrc pattern=1 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! \
videobox border-alpha=0 top=0 left=0 ! mix. \
videotestsrc pattern=15 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! \
videobox border-alpha=0 top=0 left=-320 ! mix. \
videotestsrc pattern=13 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! \
videobox border-alpha=0 top=-180 left=0 ! mix. \
videotestsrc pattern=0 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! \
videobox border-alpha=0 top=-180 left=-320 ! mix. \
videotestsrc pattern=3 ! video/x-raw-yuv, framerate=5/1, width=640, height=360 ! mix.
This is the output image= https://i.sstatic.net/4lZWL.png
and here is the code that i modified that suppose to be like this
https://i.sstatic.net/Mdsc0.png
time gst-launch -e videomixer name=mix ! ffmpegcolorspace ! xvimagesink \
filesrc location=./Cityscape1Min_720p_mp4.mp4 ! video/x-raw-yuv, framerate=5/1, \
width=320, height=180 ! videobox border-alpha=0 top=0 left=0 ! mix. \
filesrc location=./Cityscape1Min_720p_mp4.mp4 ! video/x-raw-yuv, framerate=5/1, \
width=320, height=180 ! videobox border-alpha=0 top=0 left=-320 ! mix. \
filesrc location=./Cityscape1Min_720p_mp4.mp4 ! video/x-raw-yuv, framerate=5/1, \
width=320, height=180 ! videobox border-alpha=0 top=-180 left=0 ! mix. \
filesrc location=./Cityscape1Min_720p_mp4.mp4 ! video/x-raw-yuv, framerate=5/1, \
width=320, height=180 ! videobox border-alpha=0 top=-180 left=-320 ! mix.
But it does not work. Anyone have other solutions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我喜欢这种方法,它会创建一个 2x2 的矩阵。 sink_0 是您的背景,您也可以将其设置为图像。有关画中画<的更多信息/a>.
I like this approach, it will create a matrix of 2x2. sink_0 is your background, you can also set it as an image. More info on picture in picture.
从所有实际视频中删除
framerate=5/1
。对我来说,只有videotestsrc
可以使用framerate
capfilter 进行修改。Remove
framerate=5/1
from all your actual videos. For me, onlyvideotestsrc
can be modified withframerate
capfilter.