I am troubleshooting a problem with my application that worked fine in iOS6, but when I upgraded to XCode 5 and iOS7 the AVAssetWriter quit writing video data to a file in the tmp directory. I am using AVFoundation with an AVCaptureSession to capture the video. The output file is created when the recording begins, but it is never loaded with any video data. The finishWritingWithCompletionHandler runs without any errors and calls its completion handler as expected.
Does anyone know if I need to do anything different with iOS7 that was not needed in iOS6? I have not been successful finding anything in the documentation.
Here is some more information...
Temporary file location: /var/mobile/Applications/[App ID]/tmp/[TempFileName].MOV
Video Sample Buffer Size: 1
Audio Sample Buffer Size: 1024
Any help will be greatly appreciated.
I discovered what the problem is. First I wrongly blamed the AVAssetWriter object. It was working correctly. The actual problem came from AVPlayerItem. I was using AVPlayerItem to determine the duration of the video. No matter what I tried it always returned a duration of zero which kept my video compilation getting called. Therefore to fix the problem I instead used AVAssetItem to get the video duration and that fixed my problem. I will probably report this to Apple as a bug in the AVPlayerItem object.