Is it possible to do video file “chunking”/segmenting while still recording using AVFoundation?

前端 未结 1 652
春和景丽
春和景丽 2021-02-10 09:44

I am attempting to use AVFoundation to record video on OS X but it waits till then end of the recording to save the file. I want to be able to have it save whatever it has captu

相关标签:
1条回答
  • You can ask AVFoundation to vend the frames to you as it is recording, then just pass a set number of frames to the server. But what you are asking about is extremely complicated to get right, since bandwidth or temporary network blips can cause delays/skips, etc.

    We had a discussion about doing this exact thing over here, by using AVCaptureSession with AVCaptureVideoDataOutput to vend the MPEG frames: Near Real Time Video Upload from iPhone

    If you want the individual chunks to be playable, you'll have to wrap them in a MOV or MPEG container, but it doesn't sound like you need that in your scenario.

    0 讨论(0)
提交回复
热议问题