GithubHelp home page GithubHelp logo

sdwebimage / libheif-xcode Goto Github PK

View Code? Open in Web Editor NEW
10.0 5.0 6.0 566 KB

A wrapper for libheif + Xcode project. Support Carthage && CocoaPods && SwiftPM.

C 10.46% Objective-C 7.20% Ruby 60.79% Swift 21.55%
heif macos tvos ios watchos carthage swiftpm hevc

libheif-xcode's Introduction

libheif + Xcode

CI Status Version License Platform SwiftPM compatible Carthage compatible

A wrapper for libheif + Xcode project. This enables Carthage support to build libheif as a framework for Apple's platform.

This repo also including the CocoaPods's spec file to use libheif.

Requirements

  • iOS 8+
  • macOS 10.10+
  • tvOS 9+
  • watchOS 2+

Installation

Carthage

libheif is (via this repo) available through Carthage.

github "SDWebImage/libheif-Xcode"

CocoaPods

libheif is available through CocoaPods.

pod 'libheif'

Swift Package Manager (Xcode 11+)

libheif is available through Swift Package Manager.

let package = Package(
    dependencies: [
        .package(url: "https://github.com/SDWebImage/libheif-Xcode.git", from: "1.6.1")
    ]
)

HEIF Encoding

libheif itself is not a full function decoder but an abstract layer. It needs libde265 for HEIF decoder support, and x265 for HEIF encoder support.

For CocoaPods user, you can use libx265 subspec to integrate the x265 codec supports for HEIF encoding.

pod 'libheif', :subspecs => ['libde265', 'libx265']

Since most of people's usage of this library is for HEIF decoding, and x265 is under GPLv2 license, we only integrate libheif with the Carthage dependency libde265-Xcode. To use x265 for HEIF encoding, try to build it by your own.

AVIF Decoding

  • aom

libheif from v1.7.0 added the support for AV1 Image File Format (AVIF). To keep the component functional, we only integrate the AVIF support in CocoaPods via libaom subspec.

pod 'libheif', :subspecs => ['libaom']
  • dav1d

libheif from v1.9.0 added the support to use dav1d as AVIF decoder codec.

To use dav1d as decoder codec, use the subspec like this:

pod 'libheif', :subspecs => ['libdav1d']

AVIF Encoding

  • aom

libheif from v1.7.0 added the support to use libaom as the default AVIF encoder codec. However, libaom does not performent so well on most mobile system.

pod 'libheif', :subspecs => ['libaom']
  • rav1e

There is another AVIF encoder codec, rav1e. Which added from v1.8.0 version. For CocoaPods, you can choose to use via librav1e subspec.

pod 'libheif', :subspecs => ['librav1e']

Notes:

  1. rav1e supports iOS and macOS only, because Rust language does not supports tvOS or watchOS bitcode format.
  2. rav1e only supports AVIF encoding, for AVIF decoding, you can choose to use aom, or dav1d
pod 'libheif', :subspecs => ['libdav1d', 'librav1e']
# or if you prefer aom
pod 'libheif', :subspecs => ['libaom', 'librav1e']
  • svt-av1

libheif from v1.14.0 added the support to use svt-av1 as AVIF decoder and encoder codec.

To use svt-av1 as encoder and decoder codec, use the subspec like this:

pod 'libheif', :subspecs => ['svt-av1']

License

libheif is available under the terms of the GNU Lesser General Public License. See the LICENSE file for more info.

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.