【正文】
he software,the VFW packages of Microsoft software and AVIcap window category members were taken advantage primarily to achieve the function of video streaming the same time ,it realized the Synchronized record of audio information with the aid of multimedia ponents of to captured video information,it sends windows users through frame callback function to plete the display of the timely to the users need to be videotaped,the software provides a long and short time in two modes and achieved automatic detection of the hard disk space and timely preservation of the technology of software is practical and the enviroment is stable and addition,this article provides a simple and acceptable approach for those sectors and areas that the need of video capture system is not in very high the meantime,it supplys a useful reference to the majority enthusiasts who love video programming. Key words : VFW, AVICap windows class, video capture, window capture, video dialog 目 錄 言 ................................................................ 1 .................................................... 1 開發(fā)環(huán)境 ......................................................... 1 簡介 .......................................................... 2 類 的功能與函數(shù) ............................................. 2 類 的基本功能 ........................................... 2 窗口類的主要函數(shù) 與 宏 ................................... 3 視頻捕捉結(jié)構(gòu) ................................................. 5 的 結(jié)構(gòu)與功能 ...................................................... 5 軟件的層次結(jié)構(gòu) ................................................... 5 軟件的功能 ....................................................... 5 的實(shí)現(xiàn) .................................................... 6 視頻捕獲流程 ..................................................... 6 軟件設(shè)計(jì)的實(shí)現(xiàn) ................................................... 7 ................................................... 7 .......................................... 10 .............................................. 16 設(shè)計(jì)中 的問題 .................................................... 17 ............................................................. 17 測試 技術(shù) ........................................................ 17 測試結(jié)果與評(píng)價(jià) .................................................. 18 ............................................................... 18 致 謝 ................................................................. 19 參考文獻(xiàn) ............................................................... 20 言 隨著數(shù)字視頻監(jiān)控、可視電話、電視會(huì)議等多媒體技術(shù)應(yīng)用的迅速興起,越來越多的場合需要對(duì)數(shù)字視頻信號(hào)進(jìn)行捕捉 。如本例中的 AVICAP 窗口類、 DIALOG 對(duì)話框類等。 類的主要函數(shù)與宏 AVICap 提供給開發(fā)人員一整套函數(shù),用這些函數(shù)可以實(shí)現(xiàn)許多視頻捕捉程序所需的窗口管理;同時(shí),在整個(gè)捕捉過程中仍然保留全部的控制。通常使用的 MCI 控件雖然也提供了數(shù)字視頻服務(wù) ,并為視頻疊加提供了 Overlay 命令集等,但這些命令主要是基于文件的操作,還不能滿足實(shí)時(shí)地從視頻緩存中提取數(shù)據(jù)的要求。 保存為 BMP 文件 實(shí)時(shí)拍攝,抓取瞬間圖像 ,并 保存為 BMP文件。 ( 4)打開預(yù)覽 當(dāng)捕獲窗和驅(qū)動(dòng)程序建立關(guān)聯(lián)之后,用 CapPreview 啟動(dòng)預(yù)覽功能,這時(shí)就可以在屏幕上看到來自攝像機(jī)的圖像了。高 4位對(duì)應(yīng)于最左邊的象素。 :=224。 begin if hwndc0 then begin sendmessage(hwndc,wm_cap_driver_disconnect,0,0)。 SendMessage(hWndC,WM_CAP_SET_CALLBACK_FRAME,0,LongInt(FrameCallBack))。 //關(guān)鍵,拷出視頻數(shù)據(jù) ()。 標(biāo)志 fId : longint。fname:string)。 := SamplesPerSec。 //獲取用戶文件名 fname:=copy(filename,0,length(filename)4)。)。+f+39。 if cl1500 then //硬盤空間小于 500M 時(shí)強(qiáng)制結(jié)束錄制 begin i:=i+1。對(duì)測出的數(shù)據(jù)按照公式: (簇?cái)?shù) *扇區(qū)數(shù) *每扇字節(jié)數(shù) )div(1024*1024),即可測得當(dāng)前的總?cè)萘亢褪S嗫臻g大小。 ass:=39。 對(duì)設(shè)計(jì)好的軟件,將其安裝到多臺(tái)機(jī)子上,由不同的用戶進(jìn)行測試,發(fā)現(xiàn)本軟件僅可在 WIN2020 上正常運(yùn)行,而在 WIN98,WINXP 上則無法實(shí)現(xiàn)視頻的捕捉,并提示用戶內(nèi)存地址讀寫出錯(cuò)。隨著 AVICap 窗口類與 VFW 技術(shù)的日益完善, 可以預(yù)見,在今后的一段時(shí)間里,能夠?qū)⒁纛l、視頻流直接壓縮入 AVI 文件而又相對(duì)易用的 AVICap 窗口類與 VFW 技術(shù) 將是視頻捕獲的領(lǐng)域的核心技術(shù)。 本 軟件在 Windows 2020 環(huán)境下 順利通過測試,運(yùn)行界面友好,操作簡單,系統(tǒng) 內(nèi)含萬能攝像頭驅(qū)動(dòng)程序,點(diǎn)擊驅(qū)動(dòng) 安裝菜單項(xiàng)即可自動(dòng)完成驅(qū)動(dòng)程序的安裝,對(duì)無操作經(jīng)驗(yàn)的用戶來說也可以輕而易舉的進(jìn)行錄像而不會(huì)出現(xiàn)任何困難,視頻與音頻效果都達(dá)到了預(yù)期的目的。 測試技術(shù) 軟件測試是保證軟件質(zhì)量的主要活動(dòng)之一。 if (nodenil) then begin if (=0) then begin ff:=fileopen(ExtractFilePath()+39。)。.avi39。 //可用硬盤空間 if time1=time2 then begin file1:=ExtractFilePath()+ 39。 。 有了 WAV文件頭格式和創(chuàng)建 WAV文件的過程后,就可以借助 Mediaplayer控件來完成音頻信息的錄制了 。fmt 格式 39。 CreateWavFile 過程的幾個(gè)參數(shù)意義如下 : channels 代表聲道,取 1 時(shí)代表單聲 道 ,取 2時(shí)代表立體聲 ; BitsPerSample也只有兩個(gè)值可以選擇,取 8 時(shí)代表 8 位聲音,取 16 時(shí)代表 16 位聲音 ;SamplesPerSec 則代表 每秒采樣的點(diǎn)數(shù),即聲音頻率,有 8000、 1102 22050、44100 這幾種值 , 值越大則聲音越清 晰,當(dāng)然,所錄制的文件也越大; 最后一個(gè)參數(shù) fname 則代表對(duì)應(yīng)的文件名稱 。 標(biāo)志 rLen : longint。 nn:Integer。