声子和图像支持
我正在尝试使用 Phonon 和 PyQt 构建一个简单的类似幻灯片的效果。 “幻灯片”将由图像和/或视频组成,但图像应显示一段固定的时间。 当我在 MediaSource
中排列图像时,它仅显示一小会儿。
Phonon 似乎通过后端支持图像(至少在带有 Quicktime 的 OS X 上),但我没有找到任何记录来表明这一点。 Phonon.BackendCapability.availableMimeTypes()
函数仅返回音频和视频格式; 我已成功测试过的所有格式(JPEG、PNG)均未列出。
我需要确定给定的 MediaSource 是否是图像,以便我可以告诉 MediaOjbect 暂停一段给定的时间。 当然,我可以列出一个已知图像格式扩展名的大列表,并检查媒体的文件名 - 但这很混乱。 我怎样才能用声子做到这一点?
I'm trying to build a simple slideshow-like effect using Phonon with PyQt. The "slideshow" will be made up of images and/or video, but the images should display for some fixed period of time. When I queue up an image in a MediaSource
, it is displayed for only a short moment.
Phonon appears to support images via the backend (at least on OS X with Quicktime), but I haven't found anything documented to indicate this. The Phonon.BackendCapabilities.availableMimeTypes()
function only returns audio and video formats; none of the formats I've successfully tested - JPEG, PNG - are listed.
I need to determine if a given MediaSource
is an image or not, so I can tell the MediaOjbect
to pause for some given period of time. Of course I can make a big list of known image format extensions, and check the filename of the media - but this is kludgy. How can I do this with Phonon?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可能相关: 在 py2exe-compiled 中启用对 QImage 的 JPEG 支持Python 脚本?
Possibly related: Enabling JPEG support for QImage in py2exe-compiled Python scripts?
Phonon(根据我读到的所有内容)是为显示单个音频/视频文件而设计的,所以我猜如果你想要幻灯片放映,你必须以正常的 Qt 方式显示图像,而不是使用 Phonon 来显示图像。
Phonon (from everything I've read) is designed for displaying individual audio/video files so I would guess if you want a slideshow you'd have to display images in the normal Qt way rather than using Phonon for them.