2012-06-05 201 views
2

我已經使用Visual C#語言創建了一個應用程序窗體。我使用aforge庫來顯示來自我的ip相機的圖像。問題是,如果我嘗試處理我的圖像,那麼視頻流完成緩慢。所以視頻延遲3-4秒顯示。幀率是24fps。 我想如果我改變幀速率(例如4fpm),那麼流程將會改善。那麼如何使用aforge庫改變幀速率。VideoCaptureDevice幀速率

這裏是我的代碼:

MJPEGStream mpeg = new MJPEGStream(); 
        AForge.Video.DirectShow.VideoCaptureDevice fcg = new AForge.Video.DirectShow.VideoCaptureDevice();     
        mpeg.Login = "xxx"; 
        mpeg.Password = "xxx"; 
        mpeg.Source = "http://192.168.1.xx:xx/videostream.cgi"; 
        AsyncVideoSource asyncSource = new AsyncVideoSource(mpeg);      
        mpeg.NewFrame += new NewFrameEventHandler(FinalVideo_NewFrame);    
        mpeg.Start(); 



    void FinalVideo_NewFrame(object sender, NewFrameEventArgs eventArgs) 
       { 
        video = (Bitmap)eventArgs.Frame.Clone(); 
        DisplaypictureBox.Image = video; 
       } 

回答