IOS 7: strange error AVAssetExportSession

I used AVAssetExportSession to join 2 video files. It works fine in iOS 6, but has a very strange bug in iOS 7. Let me explain this error. I have 2 video files, the first video lasts 8 seconds and the second 81 seconds. In iOS7, it will be good if I do the second + first. But if I do the first + second, it will be an error:

Domain Error = AVFoundationErrorDomain Code = -11800 "Operation could not be completed" UserInfo = 0x176cb5c0 {NSLocalizedDescription = Operation could not be completed, NSUnderlyingError = 0x176ca000 "Operation could not be completed. (Error OSStatus -12633.) Failed Nulocalon error (-12633)}

I checked exportPresetsCompatibleWithAsset and supportedFileTypes . No problem with that. Can anyone tell how to fix this? Any help would be appreciated.

Does anyone know this error :( I am providing 2mp4 files that cause the error: test 1 , test 2. The connection "test 2" + "test 1" is ok, but "test 1" + "test 2" will cause an error. This only happens in iOS7

+7
ios objective-c ios7 avfoundation
source share
3 answers

I found that you can replace AVAssetExportSession with SDAVAssetExportSession . Then you can specify settings instead of using presets that provide different results for different devices.

I had to change __weak typeof(self) wself = self; on __weak SDAVAssetExportSession * wself = self; at line 172 SDAVAssetExportSession.m .

+1
source share

I had the error "unknown error (-12633)."

Found the answer by adding two samples with the same timestamp .

Error -12633 seems to be InvalidTimestamp.

See this SO post -> unknown AVAssetWriter error

+1
source share

If you use the insertTimeRanges or insertTimeRange , you need to make sure that the input time ranges are valid. To be more specific, you should not use the duration of the resource for this, you need to get accurate time intervals from individual asset tracks.

Use the ffprobe -show_frames path_to_file to check your video files, which can sometimes be very useful.

0
source share

All Articles