2009-09-07 125 views

回答

2

JMFJava Media Framework)應該能夠檢測任何媒體,包括網絡攝像頭。

可能通過CaptureDeviceManager.getDeviceList();


對於 「JMF安裝在Linux上」,一個辦法就是:

  • download it
  • 將目錄切換到安裝位置。
  • 執行命令

% /bin/sh ./jmf-2_1_1e-linux-i586.bin 
+0

需要知道如何在Linux上安裝JMF。對此有何想法? – 2009-09-07 13:05:49

0

這裏是一段代碼我在一個簡單的網絡攝像頭客戶端使用具有JMF:

Format format = new RGBFormat(); 
MediaLocator cameraLocator = null; 
// get device list 
Vector deviceList = CaptureDeviceManager.getDeviceList(format); 
// if devices available 
if(deviceList != null && deviceList.size() > 0) { 
    // pick first 
    CaptureDeviceInfo device = (CaptureDeviceInfo) deviceList.get(0); 
    cameraLocator = device.getLocator(); 
} 

它選擇第一個可用的網絡攝像頭。當然,使用網絡攝像頭後,您可以存儲cameraLocator並嘗試在第二次運行時重新打開它。

相關問題