完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,
题: 我有一个游戏在游戏开始时启动2个或更多窗口。 有没有办法同时使用单独的输出从这两个窗口读取帧? 发生了什么: 我发生的事情是两个窗口都捕获了帧,输出视频显示的帧可以快速切换到两个窗口。 我做了什么: 我已经修改了shim程序,因此它不需要StartApp.exe来获取参数。 它现在从硬编码到NvIFREncoder.cpp的参数开始。 我希望每个窗口都以他们自己的垫片层实例开始,但似乎并非如此。 我也尝试改变缓冲区的数量(params.dwNBuffers),但该缓冲区的索引0仍然从两个窗口捕获帧。 再次提问: 那么,我究竟如何将每个窗口输出到他们自己的视频中,而不是写入同一个视频(现在正在发生的事情)? 以上来自于谷歌翻译 以下为原文 Hi, Question: I have a game that launches 2 or more windows when the game starts. Is there a way to read the frames from both these windows simultaneously with separate outputs? What's happening: What I have happening is that both windows are having their frames captured, and the output video is displaying frames that switch between the 2 windows quickly. What I've done: I've modified the shim program so that it does not need StartApp.exe to obtain parameters from. It now starts with the parameters hardcoded into NvIFREncoder.cpp. I was hoping that each window would start with their own instance of the shim layer, but it does not seem to be the case. I've also tried changing the number of buffers (params.dwNBuffers), but index 0 of that buffer still captures the frames from both windows. Question again: So, how exactly do I have each window output into their own video, instead of both writing into the same video (which is what is happening now)? |
|
相关推荐
5个回答
|
|
嗨,
垫片只创建一个NvIFREncoder,因此只生成一个H264流。 如果要捕获两个DX窗口,则需要两个NvIFREncoder实例。 加里 以上来自于谷歌翻译 以下为原文 Hi, The shim only creates one NvIFREncoder, so there's only one H264 stream generated. If you want to capture two DX windows, you need two instances of NvIFREncoder. Gary |
|
|
|
嗯,这是在IDXGISwapChain.cpp中完成的,对吗?
尤其是, static NvIFREncoder * pEncoder; pEncoder = new NvIFREncoderDXGI(this,desc.Width,desc.Height, desc.Format,FALSE,pAppParam); pEncoder-> StartEncoder(); 当前行为似乎是从两个窗口捕获并将其帧传递到此单个NvIFREncoder中。 这是否意味着我还必须创建一个额外的交换链? 然后将相应的交换链/缓冲区传递给编码器? 如下所述: NvIFREncoderDXGI *)pEncoder) - > UpdateSharedSurface(pD3D10Device,pBackBuffer) 我是DirectX编程的新手,如果我提出奇怪或明显的东西,我会道歉。 以上来自于谷歌翻译 以下为原文 Hmm, this is done in IDXGISwapChain.cpp, correct? In particular, static NvIFREncoder *pEncoder; pEncoder = new NvIFREncoderDXGI desc.Format, FALSE, pAppParam); pEncoder->StartEncoder(); The current behavior seems to be capturing from both windows and passing their frames into this single NvIFREncoder. Does this mean that I have to create an additional swap chain as well? Then pass the respective swap chain/buffer into the encoder? As done in the following: NvIFREncoderDXGI I'm very new at DirectX programming, apologies if I asking strange or obvious stuff. |
|
|
|
请检查一下
IDXGISwapChain *这个 参数对于不同的窗口具有不同的值。 如果是,请为每个人创建一个NvIFREncoderDXGI。 以上来自于谷歌翻译 以下为原文 Please check if the IDXGISwapChain * This argument has different values for the different windows. If yes, create one NvIFREncoderDXGI for each of them. |
|
|
|
他们确实不同。
我继续像你说的那样为每个人创建一个NvIFREncoderDXGI。 我现在有以下变量: NvIFREncoder * pEncoder0; NvIFREncoder * pEncoder1; IDXGISwapChain * Window0; IDXGISwapChain * Window1; 个别地,他们工作得很好。 我的意思是当我启动两个窗口时,我注释掉Window1 / pEncoder1,我可以从Window0捕获并输出到pEncoder0而没有问题。 然后我注释掉Window0 / pEncoder0并取消注释Window1 / pEncoder1。 这也很有效。 输入捕获和输出流都可以完美地工作。 但是当我同时启用时,pEncoder0和pEncoder1都从Window1获取输入(Window1在Window0之后启动)。 然而,它们都按预期输出到它们自己的流中。 这很奇怪。 我很确定我的代码中没有脑屁。 DXGI.shim.log中有一行显示“只找到一个适配器。无需进一步检查即可使用它。” 这就是我遇到问题的原因吗? 我还注意到“pEncoder-> StartEncoder()”线程实际上并没有被线程化(pEncoder0在pEncoder1启动之后才真正启动) 以上来自于谷歌翻译 以下为原文 They are indeed different. I went ahead to create one NvIFREncoderDXGI for each of them like you said. I now have the following variables: NvIFREncoder *pEncoder0; NvIFREncoder *pEncoder1; IDXGISwapChain *Window0; IDXGISwapChain *Window1; Individually, they work fine. What I mean is that when I launch both windows, I comment out Window1/pEncoder1 and I can capture from Window0 and output to pEncoder0 without issues. I then comment out Window0/pEncoder0 and uncomment Window1/pEncoder1. That works great too. The input capture and output streams all work perfectly. But when I have both enabled, both pEncoder0 and pEncoder1 are getting their input from Window1 (Window1 launches after Window0). They both output into their own stream as intended though. This is very strange. I'm quite sure I'm not having a brain fart here in my code. There's this line in the DXGI.shim.log that says "Only one adapter found. Using it without further checks." Is this the reason why I'm getting the problem I have? I've also noticed that the "pEncoder->StartEncoder()" threading isn't actually being threaded as well (pEncoder0 doesn't actually start until after pEncoder1 has started) |
|
|
|
发现了这个bug。
NvIFREncoder也需要一个额外的缓冲区变量。 Window1的数据覆盖了缓冲区。 然而,这仍然是正确的。 如果我找到原因,我会更新。 编辑:我发现了原因。 NvIFREncoder也需要额外的gpuEvent句柄(对于ppTransferCompletionEvents) 以上来自于谷歌翻译 以下为原文 Found the bug. NvIFREncoder needs an additional buffer variable as well. The buffer was being overwritten by Window1's data. However this still remains true. I'll update if I manage to find out why. Edit: I've found out why. The NvIFREncoder needs additional gpuEvent handles as well (for ppTransferCompletionEvents) |
|
|
|
只有小组成员才能发言,加入小组>>
使用Vsphere 6.5在Compute模式下使用2个M60卡遇到VM问题
3072 浏览 5 评论
是否有可能获得XenServer 7.1的GRID K2驱动程序?
3490 浏览 4 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 00:56 , Processed in 0.841100 second(s), Total 84, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号