Latest 0.1.0
Homepage https://github.com/mesbekmek/AVStitch
License MIT
Platforms ios 8.0
Authors

[![CI Status](http://img.shields.io/travis/Mesfin Bekele Mekonnen/AVStitch.svg?style=flat)](https://travis-ci.org/Mesfin Bekele Mekonnen/AVStitch)
Version
License
Platform

Overview

AVStitch is built using the AVFoundation framework and allows you to easily stitch or merge individual videos.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

ARC

Installation

AVStitch is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "AVStitch"

Documentation

Implementation

To use AVStitch you just need to import the AVExportHandler.h file into the view controller where you will have AVAssets.

For example if you use a camera, you would use the delegate method:
imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info
to store your video asset files in an array.

Then when you are ready to merge the collection of videos, you would use the AVExportHandler convenience method playerItemFromVideosArray: completion: to merge the videos.

This methods returns an AVPlayerItem which you can then use to playback the merged videos or use as you see fit.

The example below illustrates how to do this:

- (void)mergeVideosInArray:(NSArray<AVAsset *>*)videosAssestsArray {

    AVExportHandler *exportHandler = [AVExportHandler new];
    [exportHandler playerItemFromVideosArray:videosAssestsArray completion:^(AVPlayerItem *playerItem, NSError *error) {

        if (!error) {

            AVPlayerItem * pi = playerItem;
            AVPlayer *player = [AVPlayer playerWithPlayerItem:pi];
            AVVideoViewController *videoVC = [AVVideoViewController new];
            videoVC.avPlayer = player;
            [self presentViewController:videoVC animated:YES completion:nil];

        }
        else {
            NSLog(@"Error - %@",error.localizedDescription);
        }
    }];
}

Author

Mesfin Bekele Mekonnen, [email protected]

License

AVStitch is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "AVStitch",
    "version": "0.1.0",
    "summary": "Built using the AVFoundation framework, AVStitch makes it easy to merge individual videos.",
    "description": "This CocoaPod provides the ability to merge/stitch a collection of individual videos. By making use of convience methods that take in an array of AVAsset files AVStitch makes it easy to merge videos.",
    "homepage": "https://github.com/mesbekmek/AVStitch",
    "license": "MIT",
    "authors": {
        "Mesfin Bekele Mekonnen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mesbekmek/AVStitch.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/mesbekmek",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "AVStitch/Classes/**/*",
    "resource_bundles": {
        "AVStitch": [
            "AVStitch/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This