Giter VIP home page Giter VIP logo

mnavchapters's Introduction

MNAVChapters - read chapter marks

The MNAVChapters iOS library reads chapter metadata of audiovisual assets. It reads chapters from MPEG-4 and specifically MP3 files.

Build Status

Although the id3v2 standard specifies the chapter frame since 2005, I couldn't find a C or Objective-C library that parses this frame correctly. So, inspired by a post over on the auphonic blog, I started this modest Objective-C implementation.

MNAVChapter

A chapter within a media file.

Accessing Chapter Information

  • title

The title of the chapter.

(nonatomic, copy) NSString *title;
  • url

An URL string of the chapter.

(nonatomic, copy) NSString *url;
  • time

The start time of the chapter.

(nonatomic) CMTime time;
  • duration

The duration of the chapter.

(nonatomic) CMTime duration;
  • artwork

An embedded chapter image.

(nonatomic) UIImage *artwork;

MNAVChapterReader

The parser which reads chapter marks from timed audiovisual media. It attempts to read chapter information from assets with "org.mp4ra" or "org.id3" meta data formats.

Reading Chapters from an Asset

  • + chaptersFromAsset:

Make sense of an AVAsset object and, if possible, return an array of chapters.

+ (NSArray *)chaptersFromAsset:(AVAsset *)asset;

Here is an example of reading chapter marks from one the auphonic demo files:

AVAsset *asset = [self assetWithResource:@"auphonic_chapters_demo" ofType:@"mp3"];
NSArray *chapters = [[MNAVChapterReader chaptersFromAsset:asset];

Install

Add the MNAVChapters Xcode project to your workspace or, to create a release build and use the object files in the build directory, do:

$ make

If you have xctool installed, you can also run the tests from the command-line:

$ make test

Example

This repo contains an Xcode workspace to provide an easy to use example, written in Swift. When you are running the app for the first time, and tap on one of the episodes, be patient. It will have to download the media files, which, depending on your network might take some time. Once received, the files are copied to "/Library/Caches/", and onwardly read from there.

License

MIT License

mnavchapters's People

Contributors

broich avatar hackmodford avatar michaelnisi avatar

Watchers

 avatar  avatar

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.