gpt4 book ai didi

linux - Vala gstreamer 链接失败

转载 作者:太空宇宙 更新时间:2023-11-04 10:58:12 25 4
gpt4 key购买 nike

我在 vala 中播放 mjpeg 流时遇到问题。

我已经构建了我的管道,它只适用于两个元素(videotestsrc 和 cluttersink),但是如果我想添加更多,我会收到“内部数据流错误”和“流媒体任务暂停,原因未链接(-1 )”。如果我手动运行管道,它会起作用:

gst-launch souphttpsrc location=http://mjpeg.sanford.io/count.mjpeg !  multipartdemux ! jpegdec ! autovideosink

这是我的流媒体类(class):

public class Stream : Clutter.Actor {

Clutter.Texture video;

public dynamic Gst.Element playbin;


public Gst.Pipeline pipeline;
public Gst.Element demux;
public Gst.Element jpegdec;
public Gst.Element outputsink;

public dynamic Gst.Element src;
public dynamic Gst.Element video_sink;

public Stream(){

print("stream");
video = new Clutter.Texture ();

this.pipeline = new Gst.Pipeline("videopipeline");
this.src = Gst.ElementFactory.make ("souphttpsrc","httpsrc");
this.demux = Gst.ElementFactory.make ("multipartdemux","demux");
this.jpegdec = Gst.ElementFactory.make ("jpegdec","jpegdec");
this.outputsink = Gst.ElementFactory.make("autovideosink","output");
this.video_sink = Gst.ElementFactory.make ("cluttersink", "source");

this.video_sink.texture = video;

this.src.set("location","http://mjpeg.sanford.io/count.mjpeg");


this.pipeline.add_many(this.src,this.demux,this.jpegdec,this.outputsink,this.video_sink);
this.src.link(this.demux);
this.demux.link(this.jpegdec);
this.jpegdec.link(this.outputsink);
this.outputsink.link(this.video_sink);

this.add_child (video);

this.pipeline.set_state(Gst.State.PLAYING);

}





}

这是完整的错误日志: http://pastebin.com/b9GnA5ke

最佳答案

您不能将两个接收器元素附加到 jpegdec。如果您需要这样做,您应该使用“tee”元素,同时确保使用“queue”添加到 tee 的每个分支。

从 jpegdec 到 cluttersink 也可能存在上限问题。我将其结构如下:

souphttpsrc !  multipartdemux ! jpegdec ! tee name=t ! queue ! videoconvert ! autovideosink

t. ! queue ! videoconvert ! cluttersink

关于linux - Vala gstreamer 链接失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28013784/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com