Sarpkaya
Sarpkaya

Reputation: 95

GStreamer UDPSRC implementation on C#

I am trying to implement the command line script to Gstreamer c# windows forms application. I set debug to "3 > Errorlog.txt" but the file is always empty. I cant get what I am doing wrong. Command Line works perfectly but in the winforms application nothing happens.

Here is the command line script : gst-launch udpsrc port=1234 multicast-group="127.0.0.1" ! mpegtsdemux name=demuxer ! queue2 ! mpeg2dec ! ffmpegcolorspace ! videoscale ! directdrawsink

and my implementation:

 private void Start(){

            Gst.Application.Init();


            pipeline = new Gst.Pipeline();

           udpsrc = Gst.ElementFactory.Make("udpsrc", "source");


           udpsrc["port"] = 1234;
           udpsrc["multicast-group"] = "127.0.0.1";


           demux = ElementFactory.Make("mpegtsdemux", "demuxer");
           demux["name"] = "demuxer";

           queue = ElementFactory.Make("queue2", "videoq");


           decode = ElementFactory.Make("mpeg2dec", "decode");
           space = ElementFactory.Make("ffmpegcolorspace", "space");
           scale = ElementFactory.Make("videoscale", "scale");

           MyDrawSink = ElementFactory.Make("directdrawsink", "directdrawsink"); 


           pipeline.Add(udpsrc, demux, queue, decode, space, scale, MyDrawSink);

           MySinkAdapter = new XOverlayAdapter(MyDrawSink.Handle);
           MySinkAdapter.XwindowId = (ulong)this.Handle;

udpsrc.Link(demux);
           demux.Link(queue);
           queue.Link(decode);
           decode.Link(space);
           space.Link(scale);
           scale.Link(MyDrawSink);





           pipeline.SetState(State.Playing);

        }

Thanks for your time.

Upvotes: 2

Views: 1631

Answers (1)

ensonic
ensonic

Reputation: 3440

It is "2> Errorlog.txt" and not "3 > Errorlog.txt". Also to what exactly did you set GST_DEBUG?

Finally, please read about sometimes pads. This is an FAQ. You need to handle the "pad-added" signal on the demuxer and link to the queue from there.

Upvotes: 1

Related Questions