Search code examples
objective-ccocoavideo-streamingvideo-captureqtkit

How to add a socket as QTCaptureOutputs for a QTCaptureSession


I'm reading Apple's documentation on using QTKit to capture streaming audio and video from input sources. I read that the central class QTCaptureSession handles the input and sends it to every possible output (QTCaptureOutput). The documentation lists six subclasses of QTCaptureOutput (e.g., QTCaptureMovieFileOutput).

I would like to create a subclass of QTCaptureOutput to write to an NSSocket so I could send the video stream over to another machine.

Any ideas would be appreciated.


Solution

  • QTCaptureOutput does not strike me as a class designed to be subclassed outside of QTKit. Instead, you can try dumping the data to a local domain socket in the file system using a QTCaptureFileOutput object, and simultaneously pulling the data from that local domain socket and sending it over to the remote machine.