What Techniques Are Best To Live Stream iPhone Video Camera Data To a Computer?

前端 未结 2 950
不知归路
不知归路 2021-01-29 19:53

I would like to stream video from an iPhone camera to an app running on a Mac. Think sorta like video chat but only one way, from the device to a receiver app (and it\'s not vid

2条回答
  •  盖世英雄少女心
    2021-01-29 20:48

    You can use AVCaptureVideoDataOutput and a sampleBufferDelegate to capture raw compressed frames, then you just need to stream them over the network. AVFoundation provides an API to encode frames to local video files, but doesn't provide any for streaming to the network. Your best bet is to find a library that streams raw frames over the network. I'd start with ffmpeg; I believe libavformat supports RTSP, look at the ffserver code.

    Note that you should configure AVCaptureVideoDataOutput to give you compressed frames, so you avoid having to compress raw video frames without the benefit of hardware encoding.

提交回复
热议问题