Coder Social home page Coder Social logo

gpvideoclipper's Introduction

CocoaPods  CocoaPods  License 

iOS long video clip tool, similar to WeChat moments select and edit videos larger than 15s from albums, and support saving as a local album.

Related Articles:

Contents

Preview

Feature

  • Support custom UI.
  • Simple to use, only need to pass in the URL of the video.
  • Small size, low memory.

Installation

CocoaPods

  1. Specify it in your Podfile::
pod 'GPVideoClipper'
  1. then pod install or pod update
  2. import <GPVideoClipper.h>

if you can't search this repository,try update CocoaPods version or

1.pod cache clean --all

2.rm -rf ~/Library/Caches/CocoaPods

3.pod repo update

Manuel

Download GPVideoClipper and drag all files to your project.

Usage

Init GPVideoClipperController ,then set videoURL and maker,in callback handle new video info .

GPVideoClipperController *controller = [GPVideoClipperController clipperWithVideoURL:[info objectForKey:UIImagePickerControllerMediaURL] maker:^(GPVideoConfigMaker * _Nonnull maker) {
    maker.startTime = 0;
    maker.endTime = 15;
    maker.clippedVideoMinDuration = 3.0;
    maker.clippedVideoMaxDuration = 15.0f;
} callback:^(NSURL * _Nonnull videoURL, PHAsset * _Nonnull videoAsset, UIImage * _Nonnull coverImage) {
  // handle videoURL,videoAsset,coverImage
    NSLog(@"videoURL:%@ \n videoAsset:%@ \n coverImage:%@",videoURL, videoAsset, coverImage);
}];

[self.navigationController pushViewController:controller animated:NO];

Swift Version


CocoaPods  CocoaPods  License 

中文版本

iOS长视频裁剪工具,类似于微信朋友圈从手机相册选择大于15s的视频后进行裁剪,支持另存为至本地相册。

相关文章:

目录

预览

特性

  • 支持自定义UI。
  • 使用简单,仅需要传入视频的URL。
  • 体积小巧,不占用内存空间。

安装

CocoaPods

  1. 在 Podfile 中添加:
pod 'GPVideoClipper'
  1. 执行 pod installpod update
  2. 导入 <GPVideoClipper.h>

如果搜不到这个库,试着更新CocoaPods版本或者执行下面的操作:

1.pod cache clean --all

2.rm -rf ~/Library/Caches/CocoaPods

3.pod repo update

手动导入

下载 GPVideoClipper 文件夹所有内容并拖入你的工程中即可.

用法

初始化GPVideoClipperController,然后赋值videoURL和maker,最后在回调中处理新的视频信息。

GPVideoClipperController *controller = [GPVideoClipperController clipperWithVideoURL:[info objectForKey:UIImagePickerControllerMediaURL] maker:^(GPVideoConfigMaker * _Nonnull maker) {
    maker.startTime = 0;
    maker.endTime = 15;
    maker.clippedVideoMinDuration = 3.0;
    maker.clippedVideoMaxDuration = 15.0f;
} callback:^(NSURL * _Nonnull videoURL, PHAsset * _Nonnull videoAsset, UIImage * _Nonnull coverImage) {
  // 处理裁剪后的videoURL,videoAsset,视频封面
    NSLog(@"videoURL:%@ \n videoAsset:%@ \n coverImage:%@",videoURL, videoAsset, coverImage);
}];

[self.navigationController pushViewController:controller animated:NO];

Swift版本

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.