我们可以获取正在播放视频的窗口的窗口句柄吗? [英] can we get window handle of the window which is playing video?

查看:39
本文介绍了我们可以获取正在播放视频的窗口的窗口句柄吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法获取当前正在播放视频的窗口的窗口句柄.这是我的程序将拥有的唯一信息.

Is there any way to get window handle of the window which is currently playing video. This is the only information my program will be having.

更新以包含错误提供的信息作为答案

我想我应该在这里解释一下我到底想实现什么.

I think I should explain what exactly I want to achieve here.

我实际上想将我的 DVD 数据共享/流式传输到远程机器.目前我正在做的是,我正在将屏幕/视频捕获到静止帧并将其发送到远程系统,但现在我不想在我的主机上看到正在播放的视频.我能想到几个可能的解决方案,

I actually wanted to share/stream my DVD data to the remote machine. Currently what I am doing is, I am capturing the screen/video into to still frames and sending it to remote system but now I don't want to see the playing video on my host machine. I could think of few probable solutions,

1.) 如果我们可以捕获隐藏/最小化窗口的数据.

1.) If we can capture the data of a hide/minimized window.

做了一些调查,似乎不可能.请补充您的想法.

Did some investigation and seems it is not possible. Please add your thoughts.

2.) 将 DVD 数据格式转换为 ffmpeg 格式并流式传输.

2.) Convert the DVD data format into ffmpeg format and stream it.

不知道我们是否可以转换数据格式.如果大多数 DVD 格式都允许转换,那么我可以选择此选项,但不确定它有多复杂.

Don't have any idea if we will be allowed to convert the data format. If most of the DVD formats allow to covert then I can go for this option but not sure how complicated it could be.

3.) 将创建一些虚拟表面,将 DVD 数据播放到该表面并捕获该表面的屏幕.

3.) Will create some virtual surface play the DVD data to that surface and capture the screen of that surface.

再次不确定 DVD 是否会在内核模式驱动程序创建的虚拟/假表面上播放.

Again not sure if DVD will play on that virtual/fake surface created by kernel mode driver.

推荐答案

windows 上可能使用了三个主要的播放引擎;DirectShow(WMP、MPC)、ffmpeg(VLC、MPlayer)和 QuickTime.

There are probably three main playback engines used on windows; DirectShow (WMP, MPC) , ffmpeg (VLC, MPlayer) and QuickTime.

如果您仔细观察 DirectShow,就会发现它支持硬件叠加、窗口化和无窗口渲染以及 Direct3d 表面支持.

If you look closer at DirectShow will will see that it supports hardware overlays, windowed and windowless rendering and Direct3d surface support.

即使您专注于单个应用程序,您也会遇到问题,因为您不知道正在使用哪种渲染器.您可能能够找到一个始终与视频具有相同位置和尺寸的子窗口,但随后您所依赖的东西可能会在版本等之间发生变化.

Even if you focus on a single app you are going to have problems since you don't know what kind of renderer is in use. You might be able to find a child window that always has the same position and dimensions as the video, but then you are relying on things that could change between versions etc.

这篇关于我们可以获取正在播放视频的窗口的窗口句柄吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆