How can I stream iPhone Camera Data over USB as a webcam?

202 views Asked by At

I am familiar with the simple solution of just streaming over the devices screen, and bringing up a preview window and just showing the camera preview.

    let picker: UIImagePickerController = CustomUIImagePickerController()
    
    
    picker.delegate = self;
    picker.sourceType = .camera
    
    picker.setNavigationBarHidden(true, animated: false)
    picker.mediaTypes = [kUTTypeMovie as String, kUTTypeImage as String]
    picker.cameraCaptureMode = UIImagePickerController.CameraCaptureMode.video
    picker.videoQuality = UIImagePickerController.QualityType.typeHigh
    picker.showsCameraControls = false
    
    picker.cameraViewTransform.ty += 100;
    
    present(picker, animated: true, completion: nil)

The above solution only streams at a resolution of the device screen. I need a way to use the iPhone back camera as a 4k 30fps webcam. I know I can use AVCam to Write a video to file with 4k @ 30fps, but I don't know how to stream it over USB.

0

There are 0 answers