使用gstreamer管道播放带有字幕(无音频)的视频会给我带来错误

使用gstreamer管道播放带有字幕(无音频)的视频会给我带来错误,gstreamer,Gstreamer,我甚至试过 gst-launch-1.0 filesrc location=subtitleseng.srt ! subparse ! overlay. filesrc location=video.mp4 ! qtdemux ! queue ! theoradec ! ffmpegcolorspace ! subtitleoverlay name=overlay ! xvimagesink Setting pipeline to PAUSED ... Pipeline is PREROLLI

我甚至试过

gst-launch-1.0 filesrc location=subtitleseng.srt ! subparse ! overlay. filesrc location=video.mp4 ! qtdemux ! queue ! theoradec ! ffmpegcolorspace ! subtitleoverlay name=overlay ! xvimagesink

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
WARNING: from element /GstPipeline:pipeline0/GstSubtitleOverlay:overlay: Internal GStreamer error: negotiation problem.  Please file a bug at http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer.
Additional debug info:
gstsubtitleoverlay.c(799): _pad_blocked_cb (): /GstPipeline:pipeline0/GstSubtitleOverlay:overlay:
Subtitle sink is blocked but we have no subtitle caps
ERROR: from element /GstPipeline:pipeline0/GstQTDemux:qtdemux0: GStreamer encountered a general stream error.
Additional debug info:
qtdemux.c(3891): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstQTDemux:qtdemux0:
streaming stopped, reason not-linked
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
即使文件存在,也会给出此错误


请帮我解决这个问题,或者帮助我做同样的事情的方向,它对我来说是这样的-我确实看到了字幕:

gst-launch-1.0 filesrc location=/subtitleseng.srt ! subparse ! input-selector ! sub. filesrc location=video.mp4 ! decodebin ! input-selector ! streamsynchronizer name=sub ! subtitleoverlay name=sub ! xvimagesink

Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc1: Resource not found.
Additional debug info:
gstfilesrc.c(508): gst_file_src_start (): /GstPipeline:pipeline0/GstFileSrc:filesrc1:
No such file "home/usr/Downloads/video.mp4"
Setting pipeline to NULL ...
Freeing pipeline ...
诀窍在于字幕叠加之前的视频转换。。
HTH

请整理您的问题-您发布了多个非常类似的gst启动管道(我指的是一个带有转义“!”的管道,另一个没有转义“!”)-而且它们使用不同的文件路径-这非常混乱。发布一次gst启动-一次调试输出,并描述错误。。文件不在那里-您丢失/在主页之前;)此外,我认为您不能在同一个命令中键入两次gst launch-这不是它的工作方式(如果我理解0.10)。另一件事是-切换到1.x,0.10长期不受支持。我为我在发布$gst-launch-1.0 filesrc location=subtitleseng.srt问题时犯的错误感到遗憾!次屁股!输入选择器!sub.filesrc location=videocartoon.mp4!德克宾!输入选择器!streamsynchronizer name=sub!队列字幕覆盖!xvimagesinkas由于长度限制,我无法在同一条注释中添加错误。上面的错误是将管道设置为暂停。。。管道正在预滚。。。错误:来自元素/GstPipeline:pipeline0/GstFileSrc:filesrc0:内部数据流错误。其他调试信息:gstbasesrc.c(2865):gst\u base\u src\u loop():/GstPipeline:pipeline0/GstFileSrc:filesrc0:streaming task暂停,原因未协商(-4)错误:管道不想预卷。正在将管道设置为空。。。释放管道…第二条管道明显-路径不正确。。您可以使用相对路径,如
~/something/subs.srt
,或者如果您正在播放的当前目录中有
subs.srt
,也可以使用abs路径,如
/home/something/subs.srt
。。所以知道这一点,请从问题中删除第二条管道,因为它具有误导性。只需使用适当的位置,并将注意力集中在未链接的错误上。现在转到第一个管道中的真正错误-为什么要使用输入选择器?它可以选择字幕或音频。。所以我想这不是你想要的。这样做-解码mp4,解码字幕,并用字幕覆盖将其覆盖在原始帧上,然后只显示在autovideosink或任何您使用的屏幕上
gst-launch-1.0 filesrc location=cartoon.mp4 ! decodebin ! video/x-raw ! videoconvert ! subtitleoverlay name=over ! autovideosink  filesrc location=subs.srt ! subparse ! over.