khoavd-dev / MergeVideos

A demo about merging videos & images in iOS
MIT License
110 stars 30 forks source link

merge 15 to 20 images #4

Open parvendraintigate opened 6 years ago

parvendraintigate commented 6 years ago

i have used MergeVideos library making 15 to 20 images from video but issue come

Domain = AVFoundationErrorDomain Code=-11839 "Cannot Decode" UserInfo={NSLocalizedDescription=Cannot Decode, NSUnderlyingError=0x10e16d6c0 {Error Domain=NSOSStatusErrorDomain Code=-12913 "(null)"}, NSLocalizedRecoverySuggestion=Stop any other actions that decode media and try again., NSLocalizedFailureReason=The decoder required for this media is busy.}

harjeetk commented 6 years ago

Hey @parvendraintigate did you find any solution for this? I also faced the same issue on my side.

harjeetk commented 6 years ago

I have test it takes maximum 16 images to merge so you can create the different video of different images set and them merge according to them.

parvendraintigate commented 6 years ago

But have to make final video of more than 16 selected images and video to combine at a time

swami303 commented 6 years ago

Finally I found out the cause and was my bad! The problem was that I was looping through AVMutableCompositionTrack. So that each video was on a different track and probably that caused a lack of resources. Right now I created only 2 tracks: 1 for video and 1 for audio. All my videos are stitched with time ranges.

Just put this following code top of the loop

let videoCompositionTrack = mixComposition.addMutableTrack(withMediaType: AVMediaType.video, preferredTrackID: Int32(kCMPersistentTrackID_Invalid))

qiter commented 6 years ago

thx @swami303 . I'm very happy find your answer! thx so much! I megra so many image about 120 ---200.....no probolem!