Objective C : Video Compositions - objective-c

I need a bit of advice. I currently have 4 videos, 20 seconds in length each, and one MP3, 5 minutes in length.
I am merging these lot into one video, cycling every 3 seconds to the next video, for the duration of the MP3 track.
Problem 1: The videos are 20 seconds each, the MP3 is 5 minutes. It means that I will run out of video. I resolved this by running each the videos in a loop using AVMutableComposition, then exporting each of them to their new respective files.
Next, I have a fifth video in which the 4 videos plays simultaneously, each in their own quadrant of the video. This video is also compose in an AVMutableComposition which is then exported the a separate video file.
Lastly, I take these 5 videos and MP3 track, and create a composition, using AVMutableComposition again, cycling through the different videos every 3 seconds. Then I export them to the final video.
Now, the issue I'm sitting with is that exporting all those videos takes up a lot of time. Is there a way for me to use the created AVMutableComposition objects to create the final video, instead of exporting the videos and then adding them to the final composition?
Regards,
EZFrag

Related

audio stops playing after certain amount of time when triggerAttack is called

For our project, we're creating our own sampler from local audio sprites (audio length is 3 seconds for every file). Whenever we want to play a chord using triggerAttack, the sampler plays the chord for a maximum duration of 3 seconds and stops playing (I believe it's due to audio sprite's limit). Is there any way to extend the duration without altering sound files? Any help will be greatly appreciated.

How to save a video file from collection of images?

I have a folder with 18 .png files, each 800x600px. I've created a List of Bitmaps and loaded each bitmap from file, storing them as Bitmaps in the list.
I'd like to know how to write a video file (for example, .AVI) in VB .NET using the collection of images. Specifically, I'm not just looking to simply put the images together — I'd like to have the option to loop through the collection of images multiple times, adding each Bitmap as a new frame to the end of the video. This would enable me to create a 60-minute long video of the same 18 frames repeating if I wanted to.
I'd need to be able to specify the framerate, and I won't be including audio.
To put this in context, I'm effectively creating an animated image for my digital photo frame. It can't animate the GIFs it displays, but it is capable of playing videos. The 18 frames are very similar to each other.
Please help!
http://www.aforgenet.com/
The AForge Library has quite an extensive toolset for all sorts of video and image processing tasks.
Or you could use FFMPEG as a standalone tool. There you can combine images to a video:
ffmpeg Video from Images

Issues while merging the videos using AVMutableComposition

I have been working on merging of videos into a single video using the AVMutableComposition and have got the required output.But i'm getting two different types of issues while merging the videos.
1) I couldn't set the custom frames for the videos using the AVMutableVideoCompositionLayerInstruction.
2) While playing the merged video, the first merged video is been vanished(removed) after its been stopped. But the other videos are staying correctly after stopped in their respective location.
Please suggestion any solution..
1) if you want to change frame for merged video, you should set AVMutableVideoComposition render size
2) if you play first and the second video at the same time, the duration of the merged video will be the biggest duration from both videos, in that case you should handle the difference,place a kind of placeholder at the end of first video(can be last frame of the video)

Is it possible play multiple clips using presentMoviePlayerViewControllerAnimated?

I have a situation where I'd like to play 2 video clips back to back using an MPMoviePlayerViewController displayed using presentMoviePlayerViewControllerAnimated.
The problem is that the modal view automatically closes itself as soon as the first movie is complete.
Has anyone found a way to do this?
Three options:
You may use MPMoviePlayerController and start the playback of the 2nd (Nth) item after the previous is complete. This however will introduce a small gap between the videos cause by identification and pre buffering of the content.
You may use AVQueuePlayer; AVQueuePlayer is a subclass of AVPlayer you use to play a number of items in sequence. See its reference for more.
You may use AVComposition for at runtime composing one video out of the two (or N) you need to play back. Note, this works only on locally stored videos and not on remote (streaming or progressive download). Then use AVPlayer for the playback.
It's not possible. If the video assets are in local file system, consider AVComposition.

IOS Segemnting a video

I want to segment a video into 9 sections jumble the sections about and then play them together. I am currently trying to use AVPlayer to do this. I can get the sections to load on the simulator but only the first 4 will load on the actual phone. I guess the resources are topping out.
My question is: Is AVPlayer the best framework to use for this (as it seems a waste to create a player item, player and playerlayer for each segment(Which I think is why the resources are topping out)) or is there a lower framework I can use to load one video and display certain segments of it on certain sreas of the screen?
Thanks