Mac OS X相当于DirectShow,GraphEdit

时间:2023-02-02 07:52:14

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.

Mac OS X新手,熟悉Windows。 Windows具有DirectShow,大量内置过滤器,COM编程和GraphEdit,可以在您使用代码构建的图形上进行快速原型设计和窥探。

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.

我现在要去Mac上使用相机,网络摄像头,麦克风,色彩空间,文件,分割,同步,渲染,文件读取,文件保存以及我认为DirecShow认为理所当然的许多事情在整理现场表演的应用程序时。在Mac方面,到目前为止我发现......什么都没有!要么我不知道在哪里看,要么我有最艰难的时间来平衡Mac的声誉,因为它易于处理媒体,具有连贯的编程能力,可以进入并开始使用媒体操作构建模块。

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, ...

我已经看到一些弱的建议,使用gstreamer或一些库用于QT,但我不能让自己相信这是Apple的方式。我遇到过一些QuickTime文档,但我不打算做转换,精灵,广播......

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?

让大脑接受DirectShow培训意味着我甚至不知道Apple如何考虑提供类似DirectShow的功能。这意味着我不知道正确的关键字,甚至不知道在哪里看。图书?买了几个。现在我可能会编写一些可以编辑你妹妹的婚礼视频的代码(如果我不能在这个主题上取得相当好的进展,我可能接下来会问你有什么值得的),但是要确定哪些过滤器是可用的以及如何将它们串在一起......没有。建议?

1 个解决方案

#1


10  

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.

目前,视频处理在Mac上经历了巨大的转变。 QuickTime非常陈旧,但也很强大,因此在过去5年左右的时间里,它一直在进行增量替换。

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.

也就是说,QTKit是未来支持的QuickTime子集(捕获,回放,格式转换和基本视频编辑)。传统的QuickTime API目前仍然存在,并且可能至少保持其主要功能在其他地方可用,但仅为32位。对于某些涉及的视频内容,您最终可能需要在某些地方使用它。

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.

目前,iOS领先于Mac,因为它可以从头开始使用AV Foundation。 Mac媒体框架的未来很可能直接是AV基金会(QTKit是顶部的轻量级垫片)或QTKit的扩展看起来非常相似。

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.

对于音频而言,Core Audio位于Mac和iOS上,并且不会很快消失。它非常强大,但在某些地方有些迟钝。幸运的是,在线支持非常好;邮件列表是必不可少的资源。

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.

对于过滤器和帧级处理,您可以像其他人一样提到Core Video,以及Core Image。对于动态图形,Quartz Composer包含一个图形编辑器和一个插件架构来添加自己的补丁。对于程序化程序动画和轻松混合渲染模型(OpenGL,Quartz,视频等),有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:

在QuickTime(和QTKit)中,音频和视频等各种数据类型表示为轨道。可能不会立即清楚QuickTime可以打开音频以及视频文件格式。结合音频和视频的常用方法是:

  1. Create a QTMovie with your video file.
  2. 使用您的视频文件创建QTMovie。
  3. Create a QTMovie with your audio file.
  4. 使用音频文件创建QTMovie。
  5. Take the QTTrack object representing the audio and add it to the QTMovie with the video in it.
  6. 获取表示音频的QTTrack对象,并将其添加到QTMovie中,并将视频添加到其中。
  7. Flatten the movie, so it doesn't simply contain a reference to the other movie but actually contains the audio data.
  8. 展平电影,因此它不仅包含对其他电影的引用,而且实际上包含音频数据。
  9. Write the movie to disk.
  10. 将电影写入磁盘。

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 in quicktime_export.c but it doesn't seem to do audio.)

这是Blender的一个例子。您将看到如何在end_qt函数中完成A / V多路复用。那里还有一些Core Audio的使用(AudioConverter *)。 (在quicktime_export.c中有一些经典的QuickTime导出代码,但它似乎没有音频。)

#1


10  

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.

目前,视频处理在Mac上经历了巨大的转变。 QuickTime非常陈旧,但也很强大,因此在过去5年左右的时间里,它一直在进行增量替换。

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.

也就是说,QTKit是未来支持的QuickTime子集(捕获,回放,格式转换和基本视频编辑)。传统的QuickTime API目前仍然存在,并且可能至少保持其主要功能在其他地方可用,但仅为32位。对于某些涉及的视频内容,您最终可能需要在某些地方使用它。

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.

目前,iOS领先于Mac,因为它可以从头开始使用AV Foundation。 Mac媒体框架的未来很可能直接是AV基金会(QTKit是顶部的轻量级垫片)或QTKit的扩展看起来非常相似。

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.

对于音频而言,Core Audio位于Mac和iOS上,并且不会很快消失。它非常强大,但在某些地方有些迟钝。幸运的是,在线支持非常好;邮件列表是必不可少的资源。

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.

对于过滤器和帧级处理,您可以像其他人一样提到Core Video,以及Core Image。对于动态图形,Quartz Composer包含一个图形编辑器和一个插件架构来添加自己的补丁。对于程序化程序动画和轻松混合渲染模型(OpenGL,Quartz,视频等),有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:

在QuickTime(和QTKit)中,音频和视频等各种数据类型表示为轨道。可能不会立即清楚QuickTime可以打开音频以及视频文件格式。结合音频和视频的常用方法是:

  1. Create a QTMovie with your video file.
  2. 使用您的视频文件创建QTMovie。
  3. Create a QTMovie with your audio file.
  4. 使用音频文件创建QTMovie。
  5. Take the QTTrack object representing the audio and add it to the QTMovie with the video in it.
  6. 获取表示音频的QTTrack对象,并将其添加到QTMovie中,并将视频添加到其中。
  7. Flatten the movie, so it doesn't simply contain a reference to the other movie but actually contains the audio data.
  8. 展平电影,因此它不仅包含对其他电影的引用,而且实际上包含音频数据。
  9. Write the movie to disk.
  10. 将电影写入磁盘。

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 in quicktime_export.c but it doesn't seem to do audio.)

这是Blender的一个例子。您将看到如何在end_qt函数中完成A / V多路复用。那里还有一些Core Audio的使用(AudioConverter *)。 (在quicktime_export.c中有一些经典的QuickTime导出代码,但它似乎没有音频。)