來自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,偶爾視頻源會鎖定,需要我的應用程序重新啓動。 –