Git Product home page Git Product logo

avstitch's Introduction

AVStitch

[![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.

avstitch's People

Contributors

mesbekmek avatar vhart avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

vhart woodehh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.