gstreamer playbin - 在 Windows 上设置 uri
我正在尝试使用此站点上的 CLI 示例播放一些音频文件:
http:// pygstdocs.berlios.de/pygst-tutorial/playbin.html http://pygstdocs.berlios.de/pygst-tutorial/playbin.html
我在 Windows 上,读取文件时出错。我指定 以下路径:
$ python cliplayer.py C:\\voice.mp3
0:00:00.125000000 3788 009DA010 ERROR basesrc
gstbasesrc.c:2834:gst_base_src_activate_pull:<source> Failed to start in
pull mode
Error: Could not open resource for reading.
..\..\..\Source\gst-plugins-base\ext\gio\gstgiosrc.c(324):
gst_gio_src_get_stream ():
/GstPlayBin2:player/GstURIDecodeBin:uridecodebin0/GstGioSrc:source:
Could not open location file:///C:/file:/C:/voice.mp3 for reading: Error
opening file: Invalid argument
我应该如何在Windows上指定文件路径?
另外,这行代码有什么特别需要做的吗?
self.player.set_property("uri", "file://" + filepath)
谢谢你!
I am trying to play some audio files with the CLI example on this site:
http://pygstdocs.berlios.de/pygst-tutorial/playbin.html
http://pygstdocs.berlios.de/pygst-tutorial/playbin.html
I am on windows and it is giving error while reading the file. I specified
the following path:
$ python cliplayer.py C:\\voice.mp3
0:00:00.125000000 3788 009DA010 ERROR basesrc
gstbasesrc.c:2834:gst_base_src_activate_pull:<source> Failed to start in
pull mode
Error: Could not open resource for reading.
..\..\..\Source\gst-plugins-base\ext\gio\gstgiosrc.c(324):
gst_gio_src_get_stream ():
/GstPlayBin2:player/GstURIDecodeBin:uridecodebin0/GstGioSrc:source:
Could not open location file:///C:/file:/C:/voice.mp3 for reading: Error
opening file: Invalid argument
How should I specify the file path on windows??
Also, is there anything special I need to do in this line of code?
self.player.set_property("uri", "file://" + filepath)
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如您可能怀疑的那样,这段代码写得相当糟糕:
使用类似这样的内容:
并(在命令行中)以正常的 Windows 表示法指定文件路径,例如
C:\a\b.mp3
。As you may have suspected, this code is rather badly written:
Use something like this:
and (in the command line) specify the file path in normal Windows notation, e.g.
C:\a\b.mp3
.您是否注意到您获得的实际路径是
file:///C:/file:/C:/voice.mp3
?正确的路径应该是:
file:///C:/path/to/voice.mp3
。Did you notice the actual path you've got is
file:///C:/file:/C:/voice.mp3
?The correct path should be:
file:///C:/path/to/voice.mp3
.