我很想知道java怎么支持一个摄像头

解决方案 »

  1.   

    我什么都想知道.....
    GGGGGGGGGGGGG
    ZZZZZZZZZZZZZ
      

  2.   

    jmf把类型作为参数如"vfw:Microsoft WDM Image Capture (Win32):0"
    没有具体到每个摄像头.另外在一个程序中,同一类摄像头只能用一个.如何在一个java应用程序中支持多个摄像头????????
            videoCDI = CaptureDeviceManager.getDevice(
                "vfw:Microsoft WDM Image Capture (Win32):0");
            Format[] cfmts = videoCDI.getFormats();
            MediaLocator loc = videoCDI.getLocator();
            try {
                videoPlayer = Manager.createPlayer(loc);
            }
            catch (Exception e) {}
            videoPlayer.addControllerListener(this);
            videoPlayer.start();
      

  3.   

    JMFSecurityManager.loadLibrary("jmvfw");
    这条语句,调用jmvfw.dll,如何反编译过来呀!!!
      

  4.   

    videoCDI是什么呀,楼主能不能给个更完整的一小段程序谢谢啦。
      

  5.   

    Vector videoDevices; //所有视频设备的向量
        Vector devices; //所有视频、音频设备的向量
        CaptureDeviceInfo cdi; //截取视频设备信息
        VideoFormat videoFormat; //
        CaptureDeviceInfo videoCDI;
        CaptureDeviceInfo videoCDI21;
        String videoDeviceName;
        VideoFormatChooser chooserVideo;
        Player videoPlayer;
        CaptureDeviceInfo ci;
        //从摄像头中读取数据流
        void captureData() {             videoCDI = CaptureDeviceManager.getDevice(
                "vfw:Microsoft WDM Image Capture (Win32):0");
            Vector deviceList = CaptureDeviceManager.getDeviceList(new VideoFormat(
                VideoFormat.YUV));
            System.out.println("sum .." + deviceList.size());
            if (deviceList.size() > 0) {
                videoCDI = (CaptureDeviceInfo) deviceList.firstElement();
            }
            else {
                System.out.println("over...");
                return;
            }
            Format[] cfmts = videoCDI.getFormats();
            MediaLocator loc = videoCDI.getLocator();
            try {
                videoPlayer = Manager.createPlayer(loc);
            }
            catch (Exception e) {}
            videoPlayer.addControllerListener(this);
            videoPlayer.start();          } 
    //
        public synchronized void controllerUpdate(ControllerEvent event) {
            if (videoPlayer == null) {
                return;
            }
            if (event instanceof RealizeCompleteEvent) {
                visualComponent = videoPlayer.getVisualComponent();
                if (visualComponent != null) {
                    contentPane.add(visualComponent);
                }
                controlComponent = videoPlayer.getControlPanelComponent();
                if (controlComponent != null) {
                    contentPane.add(controlComponent, BorderLayout.SOUTH);
                }
                pack();
            }
        }