seanchas116 / SimpleDALPlugin

Simple CoreMediaIO DAL virtual camera plugin example written in Swift
MIT License
150 stars 19 forks source link

Implementation guidance #1

Closed brinsche closed 4 years ago

brinsche commented 4 years ago

Sorry for abusing the issues like this, but I'm interested in adapting this sample to use Android smartphones as macOS webcams, the app IP Webcam allows the device to stream a MJPEG stream of its camera via http://device_ip:port/video

Could you give me any pointers about what APIs to use to basically just open that stream and reuse it as the input for the plugin? Ideally with minimal input lag, I imagine that could be achieved by using a small buffer for the stream

Thanks in advance!

seanchas116 commented 4 years ago

I haven't tried yet but maybe replacing here with kCMVideoCodecType_JPEG makes it possible to send MJPEG as stream. Then you could create samplebuffer with CMIOSampleBufferCreate from raw JPEG from IP webcam instead of CMIOSampleBufferCreateForImageBuffer.

brinsche commented 4 years ago

Thanks for the help! I'll try from there