GStream从RTSP保存文件

时间:2011-08-11 16:13:18

标签: c# gstreamer

这适用于命令行:

gst-launch -ve rtspsrc location="rtsp://10.10.5.1:554" ! rtph264depay ! mpegtsmux ! filesink location=video.ts

但是这段代码什么都不做

Gst.Application.Init();

Pipeline pipe = new Pipeline("recorder");
        Bus b = pipe.Bus;
        b.Message += bus_Message;
        Element src = ElementFactory.Make("rtspsrc", "cam-source");
        Element sink = ElementFactory.Make("filesink","videodst");
        Element mux = ElementFactory.Make("mpegtsmux", "mux");
        Element demux = ElementFactory.Make("rtph264depay", "demux");
        src.Data.Add("location", "rtsp://10.10.5.1:554");
        sink.Data.Add("location", "out.ts");


    pipe.Add(src, sink, mux, demux);

    src.Link(demux);
    demux.Link(mux);
    mux.Link(sink);

    pipe.SetState(State.Playing);

    loop.Run();

有什么想法吗?

0 个答案:

没有答案