如何询问 gstreamer 一个文件是否可以播放?

发布于 2024-08-17 01:30:31 字数 111 浏览 5 评论 0原文

我正在尝试使用 Python Gstreamer 绑定编写一个简单的命令行音频播放器。 gstreamer API 中是否有一个函数可以提前确定特定文件 (URI) 是否可以由当前安装的编解码器集解码和播放?

I'm trying to write a simple command line audio player using the Python Gstreamer bindings.
Is there a function in the gstreamer API that determines in advance whether or not a particular file (URI) can be decoded and played by the currently installed set of codecs?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

殊姿 2024-08-24 01:30:31

我想你可以尝试播放它,看看是否会引发任何错误 - 事实上,如果不打开文件,就无法知道所需的编解码器集。有些发行版甚至设有挂钩,要求用户在开始播放某些内容时下载正确的编解码器。

I guess you can try to play it and see if that raises any error - in fact, there's no way to know the set of codecs necessary without opening the file. Some distributions even have hooks in place that ask the user to download the right codec when you start playing something.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文