从视频的每一帧中捕获单个像素行并将它们编译在一起
我正在开发一个项目,我需要从提供的视频文件的每个帧中获取单个水平或垂直像素行(或列,我猜)并从中创建图像,基本上将像素行附加到图像上整个视频。我计划提供的视频文件不是常规视频,它实际上只是视频游戏(光环:致远星)中平移摄像机的捕捉,直视下方(或游戏允许的范围内,即 -85.5 °)。我会向下看,非常缓慢地将相机向前平移到景观上,然后从捕获的视频文件(30fps)的每一帧中获取单个像素行,并将这些行编译成图像,该图像将有效(希望)将景观重建为单个图像。
我想过以快速而肮脏的方式做到这一点,使用 AxWindowsMediaPlayer 控件并锁定表单,以便它无法移动或调整大小,然后仅使用 Graphics 对象来捕获屏幕,但这不够快,会有太多问题,我需要直接访问框架。
我听说过 FFLib 和 DirectShow.NET,实际上我刚刚安装了 Windows SDK,但还没有机会弄乱 DirectX 的东西(我记得不久前当我弄乱它时,它对我来说非常困惑)与它)。希望有人能给我指明正确的方向。
如果有人有任何他们认为可能有帮助的信息,我将非常感激。谢谢你!
I'm working on a project where I need to take a single horizontal or vertical pixel row (or column, I guess) from each frame of a supplied video file and create an image out of it, basically appending the pixel row onto the image throughout the video. The video file I plan to supply isn't a regular video, it's actually just a capture of a panning camera from a video game (Halo: Reach) looking straight down (or as far as the game will let me, which is -85.5°). I'll look down, pan the camera forward over the landscape very slowly, then take a single pixel row from each frame the captured video file (30fps) and compile the rows into an image that will effectively (hopefully) reconstruct the landscape into a single image.
I thought about doing this the quick and dirty way, using a AxWindowsMediaPlayer control and locking the form so that it couldn't be moved or resized, then just using a Graphics object to capture the screen, but that wouldn't be fast enough, there would be way too many problems, I need direct access to the frames.
I've heard about FFLib, and DirectShow.NET, I actually just installed the Windows SDK but haven't had a chance to mess with and of the DirectX stuff yet (I remember it being very confusing for me a while back when I messed with it). Hopefully someone can give me a pointer in the right direction.
If anyone has any information they think might help, I'd be super grateful for it. Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用在无渲染模式(例如VMR9、EVR),它允许您自己处理每一帧。通过使用帧步进播放,您可以每次步进一帧并处理该帧。
DirectShow.NET 可以帮助您尽可能使用托管代码,我可以推荐它。然而,它只是 DirectShow 的包装器,因此寻找更高级的库可能也是值得的。
一些旁注:您不会遇到因角度不同而不同的照明问题吗?也许捕获一些屏幕截图并使用现有的拼接算法更容易?
You could use a video rendered in renderless mode (E.g. VMR9, EVR), which allows you to process every frame yourself. By using frame stepping playback you can step one frame each time and process the frame.
DirectShow.NET can help you to use managed code where possible, and I can recommend it. It is however only a wrapper to DirectShow, so it might be worthwhile to look for more advanced libraries as well.
A few sidenotes: wouldn't you experience issues with lighting which differs from angle to angle? Perhaps it's easier to capture some screenshots and use existing stitching algorithms?