c# - GStreamer-sharp 在使用 SeekFlags.Flush 搜索时冻结
问题描述
作为一种实践,我正在尝试将 GStreamer 示例从 c 转换为 c#,并且我坚持使用基本教程 4(https://gstreamer.freedesktop.org/documentation/tutorials/basic/time-management.html)。在示例中,搜索执行如下
gst_element_seek_simple (data.playbin, GST_FORMAT_TIME,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT, 30 * GST_SECOND);
我翻译成C#:
playbin.SeekSimple(Format.Time, SeekFlags.Flush | SeekFlags.KeyUnit, 30L * Constants.SECOND);
但是,在寻找之后,只播放了一帧,然后播放就卡住了。
这里有一个 C# 教程:(https://github.com/GStreamer/gstreamer-sharp/blob/master/samples/BasicTutorial4.cs)。但是,在本教程中,搜索是在没有SeekFlags.Flush
(第 73 行)的情况下执行的。示例中的搜索有效,但执行时会延迟几秒钟。
那么,是SeekFlags.Flush
C# GStreamer 绑定中的工作还是我在这里遗漏了什么?
我已经安装了最新的 GStreamer 和 GstSharp(版本 1.14.0)。
谢谢,汤姆
解决方案
我通过从 gstreamer-sharp 源 ( https://github.com/GStreamer/gstreamer-sharp )重建使它工作。
我转换为 .netstandard 2.0 并添加了 Nuget 包 GioSharp ( https://www.nuget.org/packages/GioSharp/3.22.24.36 )
或者,我重建原始 gstreamer-sharp 项目和 GtkSharp.Win32 Nuget 包(https://www.nuget.org/packages/GtkSharp.Win32/3.1.2)
希望它在官方 GstSharp Nuget 包中找到它的方式。
推荐阅读
- javascript - 返回多个模板
- php - 如何将参数从 php 传递到 linux 中的脚本?
- python - Python boto3 附加 os.env 值
- python - 在另一个模型中引用模型的单个字段?
- c++ - 如何返回输入到数组中的值的数量?
- amazon-web-services - 使用 aws_elasticache_replication_group 获取 Terraform 的端点
- java - 当字段为 LOB 时,无法从 String 转换为 Long 类型
- java - 有没有更好的方法将 xml 项添加到线性布局,以便 xml 项中的每个元素都有自己的 id?
- mongodb - 如何将 mongodb bi 连接器作为 kubernetes pod 运行
- python - 在熊猫数据框末尾提取日期