我尝试在我的 WPF 应用程序中使用 Gstreamer 显示 RTSP 流。
所以我到目前为止做了:
- 将 GStreamer 安装到 loal 文件夹 F:/gstreamer
- 创建新的 WPF 应用程序
- 添加了 glib-sharp 和 gstreamer-sharp 作为依赖项。
下面我用来初始化库的代码:
Gst.Application.Init(); // (1)
mainLoop = new GLib.MainLoop();
mainGLibThread = new System.Threading.Thread(mainLoop.Run);
mainGLibThread.Start();
Element uriDecodeBin = ElementFactory.Make("playbin", "uriDecodeBin0"); // (2)
无法加载 DLL 'libgstreamer-1.0-0.dll':找不到指定的模块。
在第 (1) 行。如果我将所有 gstreamer dll 复制到 bin/Debug 文件夹中,异常就消失了,但ElementFactory.Make第 (2) 行中的异常总是返回null,没有任何异常。如果我尝试做类似的事情
Parse.Launch(@"videotestsrc ! videoconvert ! autovideosink")
测试库功能我得到错误:
没有元素“videotestsrc”
但如果我从命令行运行它:
gst-launch-1.0 videotestsrc !视频转换!自动视频接收器
按预期工作。
所以我的问题 - 如何获得 GStreamer 锐利的工作?