3

我想使用monodevelop. 由于我需要用Gstreamer#播放音视频(实际上我必须使用Gstreamer-#),所以我尽力弄清楚如何做到这一点,但不幸的是,我没有找到任何合适的链接。

如果有人知道一些事情,如果您与我分享,我将不胜感激。

4

1 回答 1

1

就像文档说的那样,您需要引用 gstreamer-sharp.dll,而这又需要 gstreamersharpglie-0.10.dll 在同一个目录中。

Gst.Application.Init(); // First init GStreamer - important!!
var pipeDescription = "playbin uri=myVid.avi name=myBin";
var pipeline = Gst.Parse.Launch(pipeDescription) as Gst.Bin; //Launch Pipeline
var someElementInPipe = pipeline.GetChildByName("myBin") as Gst.Element;
pipeline.SetState(Gst.State.Playing);

----或使用 ElementFactory 进行手动管道构建----

Gst.Application.Init();
var pipeline = new Gst.Pipeline();
var elementA = Gst.ElementFactory.Make("someElement");
var elementB = Gst.ElementFactory.Make("someElement");
pipeline.Add(elementA, elementB);
elementA.Link(elementB);
pipeline.SetState(Gst.State.Playing);

有关更多示例,请查看以下测试: http ://cgit.freedesktop.org/gstreamer/gstreamer-sharp/tree/tests

于 2012-11-21T23:45:57.757 回答