Anime4K for Apple platforms based on Metal

Overview

Anime4KMetal

Introduction

This is a port of Anime4K to Metal. It dynamically translates GLSL shaders to Metal shaders and applies them during video playback. All shaders from the Anime4K project should work regardless of performance.

Requirements

  • Xcode 13.0+
  • iOS 15.0+
  • macOS 12.0+ (via Mac Catalyst)
  • tvOS 15.0+

Pre-built binaries

Download in Releases.

Screenshots

macOS

tvOS

Anime4K_Restore_CNN_M.glsl on M1 Mac

Anime4K_Restore_GAN_UUL.glsl on 5700XT

Anime4K_Deblur_DoG.glsl on Apple TV 4K (A10X)

Original image

*Note: The above footages are only for demo purpose.

How to use

Only mp4 files with yuv420 pixel format are supported by the built-in decoder. Other formats must be converted to the supported format.

Pick shader

Pick the desired shader under Shader selection section. Not all shaders will run well on all devices. If you see obvious dropped frames please use a smaller shader instead. Large shaders will take longer time to convert and compile. In the meantime the app will appear not responsive.

On macOS it's recommended putting the app in fullscreen mode for the best experience.

Play from URL

On tvOS no local file can be accessed. You can start a HTTP server (for example nginx) on macOS and play from URL on tvOS.

Click the cell Input URL. Input URL (http://xxx). Then click done and Play. The video should start playing

Play from file

On iOS and macOS you can simply click Select file and pick a local file to play.

Building

  1. Clone this project:
git clone https://github.com/imxieyi/Anime4KMetal.git
cd Anime4KMetal
git submodule update --init
  1. Open Anime4KMetal.xcodeproj.
  2. Select target and build.

Test shader converter

To test the shader converter simply launch the XCTest suite on a target device.

There are a ton of shader warnings due to unused variables. These messages can be ignored.

Known issues

Due to how bilinear sampler works the output image is not subpixel aligned with the original image.

License

This project is licensed under Apache 2.0 license.

Credits

  • GLSL shaders are from Anime4K
  • Shader converter referenced code from mpv
You might also like...
YHPlayer - An easy-to-use video player based on swift language
YHPlayer - An easy-to-use video player based on swift language

YHPlayer An easy-to-use video player based on swift language Features Plays loca

Awesome-swift-platforms - A curated list of Swift on different platforms

Embedded Swift A curated list of Swift on different platforms. Nintendo Switch S

Swift Package Manager plug-in to compile Metal files that can be debugged in Xcode Metal Debugger.

MetalCompilerPlugin Swift Package Manager plug-in to compile Metal files that can be debugged in Xcode Metal Debugger. Description Swift Package Manag

Imagine Engine - a fast, high performance Swift 2D game engine for Apple's platforms
Imagine Engine - a fast, high performance Swift 2D game engine for Apple's platforms

Welcome to Imagine Engine, an ongoing project that aims to create a fast, high performance Swift 2D game engine for Apple's platforms that is also a j

SwiftSocket library provides the easy way to use sockets on Apple platforms

SwiftSocket library provides as easy to use interface for socket based connections on server or client side. Supports both TCP and UDP sockets.

A native Jellyfin client for Apple platforms (iOS, macOS and tvOS)

Jellyfin Swift (working title) is a native Swift app targeting all modern Apple devices (iOS, ipadOS, tvOS and macOS).

The easy way to use sockets on Apple platforms

SwiftSocket SwiftSocket library provides as easy to use interface for socket based connections on server or client side. Supports both TCP and UDP soc

The easy way to use sockets on Apple platforms

SwiftSocket SwiftSocket library provides as easy to use interface for socket based connections on server or client side. Supports both TCP and UDP soc

Home Assistant for Apple Platforms

Home Assistant for Apple Platforms Getting Started Home Assistant uses Bundler, Homebrew and Cocoapods to manage build dependencies. You'll need Xcode

A most fully customization calendar for Apple platforms 📅
A most fully customization calendar for Apple platforms 📅

KVKCalendar KVKCalendar is a most fully customization calendar. Library consists of five modules for displaying various types of calendar (day, week,

An elegant, fast, thread-safe, multipurpose key-value storage, compatible with all Apple platforms.
An elegant, fast, thread-safe, multipurpose key-value storage, compatible with all Apple platforms.

KeyValueStorage An elegant, fast, thread-safe, multipurpose key-value storage, compatible with all Apple platforms. Supported Platforms iOS macOS watc

A powerful SwiftUI Architecture that merges Redux to the functional world of Swift. While bringing powerful workflows to streamline CoreML/Metal/IPFS usage in the Apple ecosystem.
A powerful SwiftUI Architecture that merges Redux to the functional world of Swift. While bringing powerful workflows to streamline CoreML/Metal/IPFS usage in the Apple ecosystem.

GraniteUI - v0.0 - WIP A powerful SwiftUI Architecture that merges Redux event handling and state management with functional programming. While bringi

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.

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

GPU-based media processing library using Metal written in Swift
GPU-based media processing library using Metal written in Swift

GPU-based media processing library using Metal written in Swift. Overview MetalAcc is a GPU-Based media processing library that lets you apply GPU-acc

A simple mesh viewer for MacOS based on Swift and Metal and using Assimp for loading meshes

Metal Mesh Viewer A simple triangle mesh viewer for MacOS This application is a simple (triangle) mesh viewer that should be capable of rendering even

Dogtector: dog breed detection app for iOS using YOLOv5 model combined with Metal based object decoder optimized
Dogtector: dog breed detection app for iOS using YOLOv5 model combined with Metal based object decoder optimized

Dogtector Project description Dogtector is dog breed detection app for iOS using YOLOv5 model combined with Metal based object decoder optimized for u

 Palico Engine: Metal-Based Game Engine in Swift 🐑
Palico Engine: Metal-Based Game Engine in Swift 🐑

Palico Engine: Metal-Based Game Engine in Swift 🐑 Implement a game engine on macOS using Metal API. Still in development. Currently I am working on a

Sign in with Apple, Sign up with Apple, or Continue with Apple

ContinueWithApple Sign in with Apple, Sign up with Apple, or Continue with Apple Utils 1. randomNonceString 로그인 요청마다 임의의 문자열인 'nonce'가 생성되며, 이 'nonce'

SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms
SwiftUI-compatible framework for building browser apps with WebAssembly and native apps for other platforms

SwiftUI-compatible framework for building browser apps with WebAssembly At the moment Tokamak implements a very basic subset of SwiftUI. Its DOM rende

Releases(v0.0.1)
Owner
Yi Xie
Chrome OS@Google. iOS fanboy outside work.
Yi Xie
Repository with base samples for playing HLS/DASH with CMAF video, across as many platforms as possible. Includes steps for encoding and packaging your own test content.

Video Everything Repository with minimal samples for playing HLS/DASH with CMAF video, across as many platforms as possible. Content and License All t

Alex Dodge 3 Jul 4, 2021
Overlay alpha channel video animation player view using Metal.

Overlay alpha channel video animation player view using Metal. Example To run the example project, clone the repo, and run pod install from the Exampl

noppefoxwolf 244 Jan 1, 2023
Offline playback of a fireplace video on your Apple TV

Fireplace Offline playback of a fireplace video on your Apple TV Screenshots Bring Your Own Video For copyright reasons the file fire.mp4 is not inclu

Günther Eberl 1 Dec 12, 2021
Simple macOS app that applies Apple's Person Segmentation algorithm to a video.

Simple macOS app that applies Apple's Person Segmentation algorithm to a video.

Fabio 5 Dec 9, 2022
An unofficial Floatplane client for Apple TV/tvOS

Wasserflug tvOS An unofficial Floatplane client for Apple TV/tvOS. Screenshots See https://imgur.com/a/vXAcEJy for screenshots of Wasserflug. Beta Tes

James Linnell 11 Nov 10, 2022
An *Unofficial* Uitzending Gemist application for Apple TV 4 (**deprecated, use TV Gemist ☝🏻**)

Uitzending Gemist UitzendingGemist is an unofficial native Uitzending Gemist and NPO Live application for the Apple TV 4 developed in Swift. It will a

Jeroen Wesbeek 47 Jul 20, 2022
View Rails casts video on Apple TV

View Rails casts video on Apple TV To run the app locally on your TVOS or Apple TV Clone the app Enter the http://iosvideokit.com/ license details in

Spritle Software 9 Feb 8, 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
Audio player demo based on Swift and SwiftUI, which can play local or network audio.

SwiftAudioDemo Audio player demo based on Swift and SwiftUI, which can play local or network audio. In this demo, I have made a radio player to play n

Jensen Zhang 6 Mar 13, 2022
Catalyst example of a grid-based video app that opens videos in secondary windows

Simple Catalyst example (Mac idiom) of a grid-based app populated with videos. On macOS, double-clicking a video opens it in a new playback window. Keyboard navigation is fully supported via the UIKit Focus Engine.

Steven Troughton-Smith 19 Dec 8, 2022