視頻採集: 保存一个 AVI 文件

下面這個示例程序將介紹如何使用IC Imaging Control將一個圖像數據流保存為一個AVI文件。
語言:Visual Basic 6
版本:3.0.3
发布于:2005年4月7日
作者:IC Imaging Control 技術支持部
需求:IC Imaging Control >2.1
由WDM數據流類驅動程序驅動的相機、視頻轉換器或圖像採集卡

示例程序窗口如下圖所示:

The Testdialog of IC Imaging Control,

程序開始後首先調用內置對話框(.ShowDeviceSettingsDialog)用於選擇視頻設備。 而後通過LiveStart顯示設備傳來的現場畫面數據流:

Private Sub Form_Load()

    ICImagingControl1.ShowDeviceSettingsDialog

    If Not ICImagingControl1.DeviceValid Then
        Unload Me
        Exit Sub
    End If

    ICImagingControl1.LiveStart

    cmdStopCapture.Enabled = False

End Sub

點擊"Start Capture AVI",用戶將創建一個AVI文件;單擊"Stop Capture AVI"將關閉這個文件:

Private Sub cmdStartCapture_Click()

    ICImagingControl1.LiveStop
    ICImagingControl1.AviStartCapture "video.avi", "DV Video Encoder"

    cmdStartCapture.Enabled = False
    cmdStopCapture.Enabled = True

End Sub

Private Sub cmdStopCapture_Click()

    ICImagingControl1.AviStopCapture
    ICImagingControl1.LiveStart

    cmdStartCapture.Enabled = True
    cmdStopCapture.Enabled = False

End Sub

相關源代碼示例

責任聲明
IC Imaging Control源代碼庫中的所有代碼均只用於教學目的,The Imaging Source Europe GmbH作為IC Imaging Control的開發製造商,不對任何由於使用本文或其中源代碼所產生的後果承擔責任。

该网站为The Imaging Source网络的一部分。其它的站点包括 公司, Imaging, 天文相機, Astronomy Cameras Blog, Blog caméras d'astronomie, 天文相機有獎競答, TX Text Control, LiveDocx, phpLiveDocxForum.