问题描述
在使用XAudio2和Direct3D9 / 10的应用程序中显示视频(带声音!)的最佳/最简单的方法是什么?
能够流动潜在的更大的视频,并且照顾窗口宽高比可以不同于视频(例如通过添加字母框)的事实,尽管理想地像将该视频嵌入3D场景的能力一样。 p>
我当然可以通过一种方式将每个帧加载到纹理中,丢弃/重用已渲染的纹理,并通过XAudio2单独播放音频,一个至少一种格式的加载器,ive还可以处理像同步视频和音频组件的东西,所以希望有一个更好的解决方案可用,或者甚至是一个现成的免费的解决方案,具有合适的存储(二进制形式的商业分发,动态
在Windows SDK中,有一个用于将视频渲染为纹理。它也处理音频输出。
但有限制,我不能老老实实地调用它。
What is the best/easiest way to display a video (with sound!) in an application using XAudio2 and Direct3D9/10?
At the very least it needs to be able to stream potentially larger videos, and take care of the fact that the windows aspect ratio may differ from the videos (eg by adding letter boxes), although ideally Id like the ability to embed the video into a 3D scene.
I could of course work out a way to load each frame into a texture, discarding/reusing the textures once rendered, and playing the audio separately through XAudio2, however as well as writing a loader for at least one format, ive also got to deal with stuff like synchronising the video and audio components, so hopefully there is an eaier solution available or even a ready made free one with a suitable lisence (commercial distribution in binary form, dynamic linking is fine in the case of say LGPL).
In Windows SDK, there is a DirectShow example for rendering video to texture. It handles audio output too.
But there are limitations and I can't honestly call it easy.
这篇关于在DirectX中显示视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!