Overlay alpha channel video animation player view using Metal.

Related tags

Video Kitsunebi
Overview

Overlay alpha channel video animation player view using Metal.

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 PlayerView in your view controller:

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

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

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

let baseVideoURL = Bundle.main.url(forResource: "base", withExtension: "mp4")!
let alphaVideoURL = Bundle.main.url(forResource: "alpha", withExtension: "mp4")!
playerView.play(base: baseVideoURL, alpha: alphaVideoURL, fps: 30)

Installation

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

pod 'Kitsunebi'

Author

Tomoya Hirano, [email protected]

License

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

Sample video file

http://basic.ivory.ne.jp

Backers

Split video using ffmpeg

ffmpeg -i base.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
You might also like...
 VGPlayer - 📺  A simple iOS video player by Vein.
VGPlayer - 📺 A simple iOS video player by Vein.

Swift developed based on AVPlayer iOS player,support horizontal gestures Fast forward, pause, vertical gestures Support brightness and volume adjustment, support full screen, adaptive screen rotation direction.

Open Source iOS 360 Degree Panorama Video Player.
Open Source iOS 360 Degree Panorama Video Player.

🎺 🎺 🎺 🎺 🎺 🎺 🎺 🎺 🎺 🎺 🎺 The Metal with Swift 5.0 version is comming 🎺 🎺 🎺 🎺 🎺 🎺 🎺 🎺 🎺 🎺 🎺 360 VR Player A Open Source, Ad-free, Na

FWVideoPlayer is video Player for iOS in Swift.

FWVideoPlayer Desc FWVideoPlayer is video Player for iOS in Swift. It can play video and audio. You can use it easy. Example To run the example projec

SuperVideoPlayer is video player in Objc.

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

iOS video player for trailer. You can customize layout for the control panel. Support PiP and DRM.

iOS video player for trailer. You can customize layout for the control panel. Support PiP and DRM.

IINA is the modern video player for macOS.
IINA is the modern video player for macOS.

IINA IINA is the modern video player for macOS. Website · Releases · Telegram Group Features Based on mpv, which provides the best decoding capacity o

Yattee: video player for Invidious and Piped built for iOS 15, tvOS 15 and macOS Monterey
Yattee: video player for Invidious and Piped built for iOS 15, tvOS 15 and macOS Monterey

Video player with support for Invidious and Piped instances built for iOS 15, tvOS 15 and macOS Monterey.

YouTube video player for iOS, tvOS and macOS
YouTube video player for iOS, tvOS and macOS

About XCDYouTubeKit is a YouTube video player for iOS, tvOS and macOS. Are you enjoying XCDYouTubeKit? You can say thank you with a tweet. I am also a

360 video player for iOS written in swift - a subset of SceneKit that works
360 video player for iOS written in swift - a subset of SceneKit that works

DDDKit An open source library to support 360 videos and pictures. It's designed as a generic 3D library that you can use for much more! Example of use

Comments
  • Support

    Support "HEVC Video with Alpha" files.

    This change integrates support for "HEVC Video with Alpha" files introduced in WWDC 2019 https://developer.apple.com/videos/play/wwdc2019/506/. (An "HEVC Video with Alpha" file is a QuickTime file that has two HEVC video layers: a base layer and an alpha layer.) This change mainly consists of the following parts:

    • [VieoEngine] change two Asset properties (baseAsset and alphaAsset) into an Asset array (assets):
    • [AnimationView] use the alpha plane (Plane #2) if the source asset is an "HEVC Video with Alpha" file, and.
    • [Example] update the example application so it can play "HEVC Video with alpha" files. This change DOES NOT check an "HEVC Video with Alpha" asset really has an alpha layer since it requires a method available only on Xcode 12.
    opened by hbono 1
  • main thread blockされたときにメモリー使用量急に増えないようにした

    main thread blockされたときにメモリー使用量急に増えないようにした

    原因

    frameデータ取得後にmain threadでgpulayer取得してますが、main thread blockされてしまうとframeデータ取り続けて表示されないので、メモリーがためていった。

    改修

    self.layerはmain threadで呼ぶ必要あるが、cacheされたlayerはmain thread呼ぶ必要ないので、 self.layer呼ばずにgpulayerをcacheして使うようにした

    いい副作用としてmain threadがblockされても動画は再生し続けることができる

    main thread blockしたとき挙動

    • 前:
    image
    • 後:
    image
    opened by huiping192 0
  • mp4再生で半透明になる問題修正

    mp4再生で半透明になる問題修正

    defaultのPixelFormatが kCVPixelFormatType_420YpCbCr8BiPlanarVideoRangeになっていて、rangeとしては(luma=[16,235] chroma=[16,240])のため、alpha用のr値が0,255になれなかった問題。

    metal部分でrange変更追加して修正. hevcのalpha部分は修正不要なので、処理わけるようにした

    opened by huiping192 0
Releases(1.0.2)
Owner
noppefoxwolf
きつねかわいい!!!
noppefoxwolf
Personal App that turned into "alpha released app"

Muubii Works on macos 11.0 and later* Installation Automatic install (recommended) Open Terminal. Paste the line below, once done check your applicati

Aayush 429 Jan 2, 2023
Personal App that turned into "alpha released app"

Native-Youtube Personal App that turned into "alpha released app" Requirements: MacOS 12.0 or above A working google account Usage Download the univer

Aayush 426 Dec 28, 2022
A YouTube copy for the Victor Roldan Dev channel

YouTubeClone La idea de la creación de este proyecto, es que tu tengas la oportunidad de ver como es el desarrollo completo de una aplicación, desede

Victor Roldan 11 Dec 27, 2022
📽 A video player for SwiftUI, support for caching, preload and custom control view.

Features QuickStart Advances Installation Requirements License Demo Clone or download the project. In the terminal, run swift package resolve. Open Vi

Gesen 437 Jan 5, 2023
High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.

High-performance and flexible video editing and effects framework, based on AVFoundation and Metal.

BearRuan 650 Dec 30, 2022
Musical Player - A Simple Musical Player For iOS

Musical_Player The app is a musical player. It was written as an task for a mobi

null 1 Nov 26, 2022
Player View is a delegated view using AVPlayer of Swift

PlayerView [![CI Status](http://img.shields.io/travis/David Alejandro/PlayerView.svg?style=flat)](https://travis-ci.org/David Alejandro/PlayerView) An

null 131 Oct 25, 2022
BMPlayer - A video player for iOS, based on AVPlayer, support the horizontal, vertical screen

A video player for iOS, based on AVPlayer, support the horizontal, vertical screen. support adjust volume, brightness and seek by slide, support subtitles.

Eliyar Eziz 1.8k Jan 4, 2023
▶️ video player in Swift, simple way to play and stream media on iOS/tvOS

Player Player is a simple iOS video player library written in Swift. Looking for an obj-c video player? Check out PBJVideoPlayer (obj-c). Looking for

patrick piemonte 2k Jan 2, 2023
Swifty360Player - iOS 360-degree video player streaming from an AVPlayer.

Swifty360Player iOS 360-degree video player streaming from an AVPlayer. Demo Requirements Swifty360Player Version Minimum iOS Target Swift Version 0.2

Abdullah Selek 148 Dec 18, 2022