如何通过 HDMI 1.4 在 3D 电视上创建独立于平台的 3D 视频?
我正在编写一个实时、交互式 3D 可视化程序,在程序中的每个点,我可以计算 2 个图像(位图),这些图像通过 立体镜。
如何让我的程序显示图像对,使其在 3D 电视上呈现 3D 效果?有没有一种独立于平台的方法来实现它? (我所说的平台是指独立于 GPU 品牌、操作系统、3D 电视供应商等)如果不是,哪个更好 - 通过 GPU、操作系统或 3D 电视锁定?
我想我需要在 3D 电视上使用 HDMI 1.4 电缆? HDMI 1.4 可以通过并排方法对立体进行编码。但如何将这样的编码信号发送到显示器呢?我应该使用什么样的库来做这种事情? Windows DirectShow?
如果 DirectShow 正确,是否有可用的跨平台等效工具?
如果有人问,是的,我见过这个问题: 以编程方式生成 3D 电视立体输出。
但是,如果我错了,请纠正我,它似乎不是我要找的。我没有生成多边形的 OpenGL 或 Direct3D 程序,为此 Nvidia 卡可以通过从 2 个稍微偏移的视角渲染场景,然后在显示器上显示这 2 个图像来进行临时即兴立体视觉——我的程序已经拥有这些图像对并且需要显示它们(并且它们不是渲染多边形的结果)。
顺便说一句,我以前从未做过任何主要的多媒体编程,对 HDMI、Direct Show、3D 电视等知之甚少,所以如果这个问题的任何部分完全没有任何意义,请原谅我。
I am writing a real-time, interactive 3D visualization program and at each point in the program, I can compute 2 images (bitmaps) that are meant to look 3D together by means of stereoscopy.
How do I get my program to display the image pairs such that they look 3D on a 3D TV? Is there a platform independent way of accomplishing it? (By platform I mean independent of GPU brand, operating system, 3D TV vendor, etc.) If not, which is preferable-- to lock in by GPU, OS, or 3D TV?
I suppose I need to be using an HDMI 1.4 cable with the 3D TV? HDMI 1.4 can encode stereoscopy via side-by-side method. But how do I send such an encoded signal to the monitor? What kind of libraries do I use for this sort of thing? Windows DirectShow?
If DirectShow is correct, is there a cross platform equivalent available?
If anyone asks, yes I have seen this question:
Generating 3D TV stereoscopic output programmatically.
However, correct me if I am wrong, it does not appear to be what I'm looking for. I do not have an OpenGL or Direct3D program that generates polygons, for which a Nvidia card can do ad-hoc impromptu stereoscopy simply by rendering the scene from 2 slightly offset points of view and then displaying those 2 images on the monitor-- my program already has those image pairs and needs to display them (and they are not the result of rendering polygons).
Btw, I have never done any major multimedia programming before and know very little about HDMI, Direct Show, 3D TVs, etc so pardon me if any parts of this question did not make any sense at all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以事实证明这(相对)容易。
让立体图像对以 3D 形式显示的最简单方法似乎是启用全屏模式、并排显示立体图像,然后手动将 3D 电视设置为使用并排 3D 编码。请注意,您可能需要进行一些重新定位和/或缩放,以使左/右图像正确排列并以正确的宽高比显示。
我认为这个方法应该独立于操作系统和GPU。您只需要选择任何能够在屏幕上快速连续显示图像的跨平台库即可。我用的是OpenGL。我不知道这是否是对 OpenGL 的滥用,而 DirectShow 是正确的工具。但我查看了 DirectShow SDK 示例,并不能真正理解它们(我几乎没有使用 Win32/64 API 的经验,我认为示例中使用的是 Win32/64 API。)而且 DirectShow 不是跨平台的,所以嗯。
我所做的是我有一个 PaintGL() 函数,该函数由计时器以一定的速率调用,每次调用都会计算左右图像,并排显示两个图像,进行一些定位和缩放以适当地适应屏幕。长话短说,只要您愿意使用简单的编码(例如并排)并让 3D 电视处理其余的工作,创建独立于平台的 3D 输出并不难。
旁注,在环顾四周时,我还发现 OpenGL 有先见之明,包含了立体内容的接口。显然 OpenGL 支持四缓冲(双缓冲立体视觉)。请参阅 http://www.opengl.org/sdk/docs/man/ xhtml/glDrawBuffer.xml 用于在 4 个缓冲区之间切换的函数。我最终没有使用它(因此不能保证它适合我在上面的问题中描述的特定任务),我的理解是它需要特殊的显卡支持。但我把链接放在这里以防它对任何人有用。
So it turned out to be (relatively) easy.
It seems the easiest way to get the stereo image pairs to show up in 3D is to enable fullscreen mode, display the stereo images side by side, and manually set the 3D TV to use side-by-side 3D encoding. Note that you may have to do some re-positioning and/or scaling to get the left/right images to line up correctly and show up with proper aspect ratio.
This method should be independent of OS and GPU I think. You would just have to pick any cross-platform library that is capable of displaying images very quickly in succession on the screen. I used OpenGL. I have no clue if this is an abuse of OpenGL and DirectShow is the right tool. But I looked at the DirectShow SDK examples and could not really make heads or tails of them (I have virtually no experience with Win32/64 API which I think is what is used in the examples.) Also DirectShow is not cross-platform so meh.
What I did was I had a paintGL() function that was called at a certain rate by a timer and each call computes a left and right image, displaying both side-by-side, doing some positioning and scaling to fit the screen appropriately. Long story short, it's not very hard to create platform-independent 3D output so long as you're willing to use a simple encoding like side-by-side and let the 3D TV handle the rest.
Side note, while looking around I also discovered that OpenGL had the foresight to include an interface for stereoscopic content. Apparently OpenGL supports quadbuffering (double buffered stereoscopy). See http://www.opengl.org/sdk/docs/man/xhtml/glDrawBuffer.xml for a function to switch between the 4 buffers. I didn't end up using it (and thus cannot vouch that it is appropriate for the specific task I describe in my question above) and my understanding is that it requires special graphics card support. But I put the link here in case it's useful to anyone.