Mac OS X 相当于 DirectShow、GraphEdit
Mac OS X 新手,熟悉 Windows。 Windows 具有 DirectShow、大量内置过滤器、COM 编程和 GraphEdit,可以非常快速地构建原型并窥探您在代码中构建的图形。
我现在要在 Mac 上使用相机、网络摄像头、麦克风、色彩空间、文件、分割、同步、渲染、文件读取、文件保存以及许多我在 DirecShow 中认为理所当然的事情将应用程序组合在一起进行现场表演时。在 Mac 方面,到目前为止我还没有发现……什么也没有!要么我不知道该去哪里寻找,要么我正经历着最艰难的时期,将 Mac 因易于处理媒体而闻名的声誉与连贯的编程能力联系起来,开始搞乱媒体操纵的构建块。
我看到了一些关于使用 gstreamer 或 QT 库的弱建议,但我无法让自己相信这是 Apple 的做法。我读过一些 QuickTime 文档,但我不打算做转换、精灵、广播……
大脑受过 DirectShow 训练意味着我什至不知道 Apple 如何考虑提供类似 DirectShow 的功能。这意味着我不知道正确的关键词,甚至不知道去哪里寻找。图书?买了几个。现在我也许可以编写一些代码来编辑你姐姐的婚礼视频(如果我不能在这个主题上取得不错的进展,我接下来可能会问这对你来说有什么价值),但要确定哪些过滤器可用以及如何将它们串在一起......什么都没有。建议?
New to Mac OS X, familiar with Windows. Windows has DirectShow, a good number of built-in filters, COM programming, and GraphEdit for very fast prototyping and snooping on the graphs you've constructed in code.
I'm now about to go to the Mac to work with cameras, webcams, microphones, color spaces, files, splitting, synchronization, rendering, file reading, file saving, and many of things I've come to take for granted with DirecShow when putting together applications for live performance. On the Mac side, so far I've found ... nothing! Either I don't know where to look or I'm having the toughest time tying the Mac's reputation for its ease of handling media with a coherent programmatic ability to get in there and start messin' with media manipulatin' building blocks.
I've seen some weak suggestions to use gstreamer or some library for QT but I can't bring myself to believe that this is the Apple way to go. And I've come across some QuickTime documentation but I'm not looking to do transitions, sprites, broadcasting, ...
Having a brain trained on DirectShow means I don't even know how Apple thinks about providing DirectShow-like functionality. That means I don't know the right keywords and don't even know where to look. Books? Bought a few. Now I might be able to write some code that can edit your sister's wedding video (if I can't make decent headway on this topic I may next be asking what that'd be worth to you), but for identifying what filters are available and how to string them together ... nothing. Suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前,Mac 上的视频处理正在经历巨大转变。 QuickTime 非常古老,但也非常强大,因此在过去 5 年左右的时间里它一直在经历增量替换过程。
也就是说, QTKit 是 QuickTime 子集(捕获、播放、格式转换和基本视频编辑),今后将受到支持。遗留的 QuickTime API 目前仍然存在,并且可能至少会保留到其主要功能在其他地方可用之前,但仅限于 32 位。对于一些涉及的视频内容,您最终可能需要在某些地方使用它。
目前,iOS 领先于 Mac,因为它可以从头开始 AV 基金会。 Mac 媒体框架的未来可能要么直接是 AV Foundation(QTKit 是顶部的轻量级垫片),要么是看起来非常相似的 QTKit 扩展。
对于音频,Core Audio 已在 Mac 和 iOS 上运行,并且不会很快消失。它非常强大,但有些地方有点迟钝。幸运的是,在线支持非常好; 邮件列表是一项重要资源。
对于滤镜和帧级处理,您有 核心视频正如其他人提到的,以及核心图像。对于动态图形,有 Quartz Composer,其中包括图形编辑器和插件架构,可用于添加您自己的补丁。对于程序化动画和轻松混合渲染模型(OpenGL、Quartz、视频等),有核心动画< /a>.
除了所有这些之外,当然,如果内置的东西不能满足您的要求,您当然没有理由不能使用开源库。
要在下面解决您的评论:
在 QuickTime(和 QTKit)中,音频和视频等单独的数据类型表示为轨道。可能目前还不清楚 QuickTime 是否可以打开音频和视频文件格式。组合音频和视频的常见方法是:
QTMovie
。QTMovie
。QTTrack
对象,并将其添加到包含视频的QTMovie
中。这是来自 Blender 的示例。您将在
end_qt
函数。其中还使用了一些 Core Audio (AudioConverter*
)。 (quicktime_export.c
但它似乎不做音频。)Video handling is going through a huge transition on the Mac at the moment. QuickTime is very old, but also big and powerful, so it's been undergoing an incremental replacement process for the past 5 years or so.
That said, QTKit is the QuickTime subset (capture, playback, format conversion and basic video editing) which is supported going forward. The legacy QuickTime APIs are still there for the moment, and probably will remain at least until its major features are available elsewhere, but are 32-bit only. For some involved video stuff you may end up needing to use it in places.
At the moment, iOS is ahead of the Mac because it could start from scratch with AV Foundation. The future of the Mac media frameworks will probably either be AV Foundation directly (with QTKit being a lightweight shim over the top) or an extension of QTKit that looks very similar.
For audio there's Core Audio which is on Mac and iOS and isn't going away any time soon. It's quite powerful but somewhat obtuse in places. Luckily online support is very good; the mailing list is an essential resource.
For filters and frame-level processing you've got Core Video as someone else mentioned, as well as Core Image. For motion graphics there's Quartz Composer which includes a graphical editor and a plugin architecture to add your own patches. For programmatic procedural animation and easily mixing rendering models (OpenGL, Quartz, video, etc.) there's Core Animation.
In addition to all of these, of course there's no reason you can't use open source libraries where the built-in stuff doesn't do what you want.
To address your comment below:
In QuickTime (and QTKit), individual data types like audio and video are represented as tracks. It may not be immediately clear that QuickTime can open audio as well as video file formats. A common way to combine audio and video would be:
QTMovie
with your video file.QTMovie
with your audio file.QTTrack
object representing the audio and add it to theQTMovie
with the video in it.Here's an example from Blender. You'll see how the A/V muxing is done in the
end_qt
function. There's also some use of Core Audio in there (AudioConverter*
). (There's some classic QuickTime export code inquicktime_export.c
but it doesn't seem to do audio.)