开发者

Saving the video when app is interrupted by call

I setup and use AVAssetWriterInput --- AVAssetWriter chain to record a video. This works fine. When the video recording is stopped, AVAssetWriter's finishWriting returns a status saying it is Completed. However, if the recording is interrupted by a call then the finis开发者_StackOverflow社区hWriting status says it is Failed and the video is not saved.

To fix this issue, following line of code is used.

self.assetWriter.movieFragmentInterval = CMTimeMakeWithSeconds(1.0, 1000000000);

Here, even if the status says Failed, the video is saved.

Will this affect the performance, as the header is now added at regular intervals to the recording video? Also, is it right to hard code the values say, 1000000000?

Thanks in advance for your time and help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜