Overlay alpha channel video animation player view using OpenGLES.
Switch branches/tags
Clone or download
tomoya.hirano
tomoya.hirano update version
Latest commit b325cb9 Sep 18, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Carthage/Kitsunebi support carthage May 12, 2018
Example support swift 4,2 Sep 18, 2018
Kitsunebi support swift 4,2 Sep 18, 2018
meta add sample gif Apr 18, 2018
.gitignore refactor Apr 13, 2018
.swift-version update version Sep 18, 2018
.travis.yml Initial commit Apr 12, 2018
Kitsunebi.podspec support swift 4,2 Sep 18, 2018
LICENSE Initial commit Apr 12, 2018
README.md 動作を軽量化 Aug 17, 2018
_Pods.xcodeproj Initial commit Apr 12, 2018

README.md

Overlay alpha channel video animation player view using OpenGLES.

Example

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

Usage

At the top of your file, make sure to import Kitsunebi

import Kitsunebi

Then, instantiate KBAnimationView in your view controller:

private lazy var playerView: KBAnimationView = KBAnimationView(frame: view.bounds)!

override func viewDidLoad() {
    super.viewDidLoad()
    view.addSubview(playerView)
}

You can play transparency video any framerate. mainVideo is colornize video, alphaVideo is alpha channel monotone video. please see example video files.:

playerView.play(mainVideoURL: Bundle.main.url(forResource: "main", withExtension: "mp4")!,
                    alphaVideoURL: Bundle.main.url(forResource: "alpha", withExtension: "mp4")!,
                    fps: 30)

customize video quality

If video playing are slow, change quality.

playerView.quality = .low

Installation

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

pod 'Kitsunebi'

Author

Tomoya Hirano, noppelabs@gmail.com

License

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

Sample video file

http://basic.ivory.ne.jp

MEMO

ffmpeg -i main.mp4 -i alpha.mp4 -filter_complex "nullsrc=size=1500x1334 [base];[0:v] setpts=PTS-STARTPTS, scale=750x1334 [left];[1:v] setpts=PTS-STARTPTS, scale=750x1334 [right];[base][left] overlay=shortest=1 [tmp1];[tmp1][right] overlay=shortest=1:x=750" output.mp4