【问题标题】:Vala gstreamer link failedVala gstreamer 链接失败
【发布时间】:2015-01-18 19:21:00
【问题描述】:

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

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

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

这是我的流媒体课程:

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

【问题讨论】:

    标签: linux gstreamer pipeline vala


    【解决方案1】:

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

    从 jpegdec 到 cluttersink 也可能存在大写问题。我的结构如下:

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

    【讨论】:

    • 谢谢,我试过了,但是没有用。同样的错误。
    • 你能粘贴你更新的管道吗?您还可以在命令行上执行“gst-inspect cluttersink”吗?我找不到有关其大写字母的文档。
    猜你喜欢
    • 1970-01-01
    • 2013-10-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-03
    • 2016-12-30
    • 1970-01-01
    相关资源
    最近更新 更多