问题描述
我想知道是否有可能使multifilesrc正常工作。我使用的是最新的gstreamer版本,无法进行简单的视频循环。我已经尝试了上述多次迭代,以展示其中一些:
gst-launch-1.0 multifilesrc location="./short.mp4" loop=TRUE index=0 ! decodebin ! autovideosink
gst-launch-1.0 multifilesrc location="./short.mp4" loop=TRUE ! decodebin ! autovideosink
gst-launch-1.0 multifilesrc location="./short.mp4" loop=true ! decodebin ! autovideosink
gst-launch-1.0 multifilesrc location="./short.mpg" loop=true ! decodebin ! autovideosink
有人知道循环中缺少什么吗?我还添加了原始大写过滤,无济于事。使用multifilesrc上的图像,我可以非常轻松地完成此操作,但是使用视频无法正常工作。我需要该脚本来重复较大脚本中提供的视频文件,但即使在最基本的水平上也无法使其正常工作。
根据https://gstreamer.freedesktop.org/documentation/multifile/multifilesrc.html?gi-language=c,应该在所有媒体上都可以。
解决方法
multifilesrc
元素并非旨在循环播放视频流。根据文档,此元素Reads buffers from sequentially named files. [...] File names are created by replacing "%d" with the index using printf().
。因此,例如使用000.png
至999.png
之类的图像制作视频会很有用。如果使用loop=True
,该元素将在000到999之间重播流。
我认为无法在GStreamer中循环播放视频,请参见Looping a video with gstreamer and gst-launch?