我现在想用iphone做视频监控,控制摄像头(usb Camera,和ip Camera),现在能提取视频的关键帧并现在在UIImageView上,但是我怎么才能获取摄像头动态的视频流呢?请各位指点下,先谢过!

解决方案 »

  1.   

    AVCaptureSession *captureSession = <#Get a capture session#>;
    AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:captureSession];
    UIView *aView = <#The view in which to present the layer#>;
    previewLayer.frame = aView.bounds; // Assume you want the preview layer to fill the view.
    [aView.layer addSublayer:previewLayer];
      

  2.   

    http://developer.apple.com/library/ios/#qa/qa1702/_index.html
      

  3.   

    视频部分参阅 UIImagePickerController,
    实现一个UIImagePickerController的实例,实现里面的UIImagePickerControllerDelegate就可以了!
    需要查看UIImagePickerController中是不是支持视频,检测是否有kUITypeMovie常数通信部分请参阅 Game Kit 的 GKSession 类, GKVoiceChatService 类等用Xcode的cocoa,实现起来很简单~~
      

  4.   

    to cloudhsu  and ybh37:但是我怎么拿网络摄像头的数据呢?