来自Windows USB设备的视频流是颠倒的我正在使用AForge.net version 2.25来显示USB数字显微镜的视频输入,Celestron 44302-B。使用显微镜软件,可以在Windows 7 x64工作站上正确显示视频。使用AForge
代码基于Aforge的示例应用程序。结果如下所示,其中AForge.Controls.videoSourcePlayer中的视频馈送是颠倒的。
我可以轻松地翻转一个位图(从视频流中获取快照),但我希望允许用户在视频输入连接并运行时定位并聚焦显微镜。
using AForge.Controls
using AForge.Video;
using AForge.Video.DirectShow;
void connectButton_Click(object sender, EventArgs e)
{
VideoCaptureDevice _videoDevice = new VideoCaptureDevice(_videoDevices[devicesCombo.SelectedIndex].MonikerString);
if (_videoDevice != null)
{
if ((_videoCapabilities != null) && (_videoCapabilities.Length != 0))
{
_videoDevice.VideoResolution = _videoCapabilities[videoResolutionsCombo.SelectedIndex];
}
if ((_snapshotCapabilities != null) && (_snapshotCapabilities.Length != 0))
{
_videoDevice.ProvideSnapshots = true;
_videoDevice.SnapshotResolution = _snapshotCapabilities[snapshotResolutionsCombo.SelectedIndex];
_videoDevice.SnapshotFrame += videoDevice_SnapshotFrame;
}
EnableConnectionControls(false);
videoSourcePlayer.VideoSource = _videoDevice;
videoSourcePlayer.Start();
}
}
你确定显微镜不是回到前面吗? –
我不这么认为,因为我最初使用了DirectShowLib-2005,视频方向正确。但是,DirectShowLib有点bug,偶尔视频源会锁定,需要我的应用程序重新启动。 –