.mov split with iOS SDK? - ios

Is something like this possible? I searched a lot but the ways I found are on mac os.
What I want to do is split a video to many videos so each file will have smaller size.
Can anyone guide me through?

You can do this in bacground using AVFoundation:
Trimming and transcoding a movie
You can also do this using the trimming UI:
UIVideoEditController Class Reference

Related

Any way to have a real-time preview of AVMutableComposition? If no, how does Final Cut Pro does it?

is it possible to have a real-time preview of AVMutableComposition which has some layer instructions applied to its assets?
The only class I found that connects AVMutableComposition with AVVideoComposition (holding instructions) is AVExportSession. Does it mean I must export it first to play a preview?
If so, how does apps like Final Cut Pro serve real-time preview when I edit part of the video. Do they cut the whole video into multiple chunks, export what has changed and keep change of everything else?
This sounds like a difficult problem - is there any library that would help in cutting video into small chunks to export and keeping an eye on cache invalidation?
Cheers,
M.
I don't know if this is still relevant but you can always extract each frame from the video, manipulate it accordingly then render it to the screen.
If its from AVCaptureSession you can get CMSampleBuffer from the callbacks, if it's a file I think AVReader is your best bet then you can use either CoreImage or Metal to manipulate the frames and render them in real-time.
There is no real time preview with AVMutableComposition , they may create a time slot for every change and manage it's visibility when you change the slider below

Generating Video from images

I am working on generating .mp4 Video from array of Images with some transition effect. Is there any Library of SDK is available for this. Please help.
Please check the below video URL about what I am looking for.
https://www.dropbox.com/s/242azi2totylmaa/Screen%20Recording.mov?dl=0
This video I have generated from one demo I got on Github but it is only playing the images with the transition effect but I want to generate .MP4 video.
If anybody knows the solution please help.
Thank you in advance.
You can achieve what you want by using AVVideoCompositionCoreAnimationTool and AVAssetExportSession from AVFoundation Framework to create video from images with animation.
Here is nice tutorial under the section Roger Rabbit, Eat Your Heart Out — Add Animation to Videos

Animated overlay for videos on iOS

What's the common modern standard for animated video overlays? (e.g. if you want to add an animated logo to video recorded from the camera)
During research, I've found the following options:
GIF - seems to be pretty outdated technology
FLV - supports alpha-channel, but no longer supported by Adobe.
Requires FFMPEG.
PNG sequence - the downside of this is having multiple files for each
frame.
What's the right format/technology to use?
Ideally, what is natively supported on iOS (doesn't require FFMPEG)?
If you want to overlay your custom video animation over video which user will be recorded I suggest to use GPUImage framework which allow a lot video/photo customization's and different graphic effects. For example how to mix two videos: nice article. Also I suggest you to read article about Chroma key which are something like standard of video/photo mixing. (because as I understand you just want make something like watermark?). GPUImage also has Chroma key filter which you can use in your purpose.
By default Apple supports h264 codec in mp4 container. So your video should be in this codec.
Hope I fully answered on your question
The best way to add overlays using the AVFoundation framework supplied by apple itself. Speaking about the other ways such as GIF, FLV, they are not supported natively by APPLE which puts you out of luck.
Apple suggests various tools such as AVVideoCompositionCoreAnimationTool that lets you stitch the Core Animations and the videos together.
Here is a link that explains how to add various effects such as
Colored borders with custom sizes.
Multiple overlays.
Text for subtitles or captions.
Tilt effects.
Twinkle, rotate, and fade animation effects!
I am not sure how much of this is application for the application that wanted to add animations while recording. May be some one else could help in it. I hope this helps you about the native way to add animations in recorded videos in iOS.

Use a Video as Landing Page background (as seen in Spotify, Twitter or Vine)

I'd like to set a video as background to a view. I found multiple solutions, each one with great drawbacks, like:
Using MPMoviePlayerController, it works ok. The video has the best quality, however it uses a lot of cpu (~50% on my mac). I didn't dare to test it on my phone.
Converting the video to a .gif and displaying it with a UIWebView. This is a great solution, but i couldn't make a high quality gif. The video has lots of movement which is not suited for gif files.
Is there a better solution? I'd appreciate any help. Thanks.
I did that before using AVPlayer. It was since iOS 4 (long time ago), and it didn't cause any noticeable effect on the performance.

Effect to audio and video file

In my app I want to give effect to audio and video file like it is given to Pheed Application. I want to mix audio recorded sound with predefine clips. And also want to give sound different effect like echo , surrounding Normal , And with video file I want to add different effects like sepia,.. I don't know which class library I have to use to implement6 this . Can any one suggest me any library for that or any way how to do that?
Here are a pair of libraries you can try:
For audio filters and effects you can try with The Amazing Audio Engine. It is build on top of Core Audio.
For video effects try GPUImage. I haven't tried it but it is supposed to work better than Core Image when handling videos.

Resources