Creating CMSampleBufferRef from the data

前端 未结 2 1981
故里飘歌
故里飘歌 2021-02-04 16:06

I am trying to create a CMSampleBuffer Ref from the data and trying to feed it to AVAssetWriter. But asset writer is failing to create the movie from the data. Following is the

2条回答
  •  Happy的楠姐
    2021-02-04 16:40

    You should look into AVAssetWriterInputPixelBufferAdaptor - it accepts CVPixelBuffers so you don't need to convert the CVPixelBuffer in a CMSampleBuffer.

    here is a link to a thread about it on the apple dev forum -> https://devforums.apple.com/thread/70258?tstart=0

    Also - any chance you could post your project file or sample code of the capture movie working -- I am using the default CMSampleBuffer from the AVFoundation data output callback method - but when I save it to camera roll it is all black except the last 5 frames which I have to manually scrub to :S

    any help in regards to my issue would be greatly appreciated.

    Cheers,

    Michael

提交回复
热议问题