• This repository has been archived on 25/Jul/2020
  • Stars
    star
    216
  • Rank 183,179 (Top 4 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created about 11 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ogg and WebM media playback for iOS

THIS PROJECT IS NO LONGER UNDER DEVELOPMENT. NO SUPPORT IS IMPLIED OR PROVIDED. DO NOT USE FOR ANY PURPOSE.

Recommend using VLCKit or GStreamer instead.


Lightweight iOS media player widget for free Ogg Theora/Vorbis and WebM VP8/VP9 codecs.

Currently provides a basic high-level player widget (OGVPlayerView) that can stream audio and video files over HTTP(S), including seeking if Range: header is supported, or from the local filesystem.

Will continue to improve this interface and add lower-level interfaces suitable for transcoding to/from AVFoundation formats. See the Roadmap section below for more detailed plans.

Player example

Status

Containers:

  • Ogg
    • playback: yes
    • duration: yes (uses skeleton or slow seek)
    • seeking: yes (uses skeleton or slow bisection)
  • WebM
    • playback: yes
    • duration: yes
    • seeking: yes (requires cues)
    • muxing: yes (VP8 and Vorbis only; API in flux)
  • MP4 (backed by AVFoundation)
    • playback: yes (from URLs only)
    • duration: yes
    • seeking: yes

Video:

  • Theora (ogg only)
    • decode: yes
    • encode: not yet
  • VP8 (WebM only)
    • decode: yes
    • encode: yes; API in flux
  • VP9 (WebM only)
    • decode: yes
    • encode: not yet

Audio:

  • Vorbis
    • decode: yes; API in flux
    • encode: not yet
  • Opus
    • decode: yes
    • encode: not yet

Getting started

Install CocoaPods

You'll need CocoaPods installed if not already for package management:

sudo gem install cocoapods

See detailed CocoaPods setup guide if necessary.

Building the example

First, get the source:

git clone https://github.com/brion/OGVKit.git
git submodule update --init

Set up the development pods so the example can build:

cd Example
pod install

Now open OGVKit.xcworkspace -- the workspace NOT the project! And build.

Using OGVKit

Adding to your project

To use the current release in your project, set up some stuff in your Podfile like so:

use_frameworks!

source 'https://github.com/CocoaPods/Specs.git'

# This line is needed until OGVKit is fully published to CocoaPods
# Remove once packages published:
source 'https://github.com/brion/OGVKit-Specs.git'

target 'MyXcodeProjectName' do
  pod "OGVKit"
end

By default, all supported file formats and codecs will be enabled. To strip out unneeded formats, use subspecs instead of specifying the default 'OGVKit':

Just WebM files, all default codec variants (VP8, Vorbis):

  pod "OGVKit/WebM"

Just Ogg files, all codec variants (Theora, Vorbis):

  pod "OGVKit/Ogg"

Just Ogg files with Vorbis audio, with no video codecs enabled:

  pod "OGVKit/Ogg/Vorbis"

It may be necessary to disable bitcode on the entire project. To ensure that generated pods projects have bitcode disabled, add to the Podfile a section:

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['ENABLE_BITCODE'] = 'NO'
      end
    end
  end

Instantiating a player programmatically

Warning: this API is not yet finalized.

#import <OGVKit/OGVKit.h>

-(void) somethingOnYourViewController
{
    OGVPlayerView *playerView = [[OGVPlayerView alloc] initWithFrame:self.view.bounds];
    [self.view addView:playerView];
    
    playerView.delegate = self; // implement OGVPlayerDelegate protocol
    playerView.sourceURL = [NSURL URLWithString:@"http://example.com/path/to/file.webm"];
    [playerView play];
}

If Ogg or WebM data has been previously downloaded into an NSData memory blob, you can read this memory directly instead of reading via a file:

// from live HTTP(S) or file URL:
playerView.inputStream = [OGVInputStream inputStreamWithURL:@"http://example.com/path/to/file.webm"];

// from NSData
NSData *data = ...;
playerView.inputStream = [OGVInputStream inputStreamWithData:data];

Instantiating a player in Interface Builder

TODO: make easier to use in IB if possible

  • add a generic UIView to your interface
  • set the custom class to OGVPlayerView
  • once in the program, treat as above

Getting updated on player state

OGVPlayerView supports a delegate protocol, OGVPlayerDelegate. This is not a finalized API and may change.

Roadmap

See milestones in issue tracker for details:

  • v0.5 initial CocoaPods-compatible release
  • v0.5.1 added local filesystem URL support
  • v0.5.2 exposed inputStream and memory data input, fixed VP9
  • v0.5.3 fixed playback after end, ogg seek fail handling
  • v0.5.4 'brute force' seek for WebM audio without cues
  • v0.5.5 initial MP4 support, various seek & audio fixes
  • v0.5.6 end-of-file fixes with some edge cases
  • v0.5.7 more seek-to-end fixes
  • v0.5.8 fix regressions and old bugs in audio dropout case
  • v0.5.9 fix regressions and old bugs in audio, threading
  • ... various fixes ...
  • v0.5.13 added Opus for Ogg container

Future:

  • v1 stable player API
  • v1.1 extras: fullscreen, AirPlay, etc
  • v1.2 performance
  • v1.3 adaptive bitrate streaming
  • v2 internals and API refactor
  • v2.1 encoder & transcoding

More Repositories

1

ogv.js

JavaScript media player using Ogg/Vorbis/Theora/Opus/WebM libs compiled with Emscripten
JavaScript
1,197
star
2

yuv-canvas

JS class to draw YUV image frame buffers to an HTML5 canvas
JavaScript
271
star
3

mtpng

A parallelized PNG encoder in Rust
Rust
206
star
4

hdrfix

tool for converting HDR screenshots to SDR with suitable tone-mapping
Rust
114
star
5

audio-feeder

Small JS library to abstract Web Audio raw PCM output
JavaScript
53
star
6

yuv-buffer

YUV image frame buffer helper utilities for JavaScript
JavaScript
38
star
7

wasm2swf

Experimental WebAssembly to ActionScript bytecode translator
JavaScript
19
star
8

gimp-icns

Gimp image editor plugin to load and save Mac OS X .icns icon resource files
C
18
star
9

stream-file

Small JS library to abstract streaming of large files via XHR w/ Range-based chunking
JavaScript
18
star
10

jsdec-openh264

Experimental OpenH264 emscripten build for Gecko experimental JavaScript video decoding API
C++
15
star
11

StatusNet

alternate copy of StatusNet repo from our Gitorious master
PHP
14
star
12

librsvg

Test fork of librsvg from git.gnome.org
C
12
star
13

aotjs

Experimental ahead-of-time JavaScript compiler targetting WebAssembly and native
C++
12
star
14

min-wasm-fail

Minimal test case for iOS 11.2.2/11.2.5 wasm failure
JavaScript
10
star
15

BugTender

mobile web app to manage Bugzilla from your phone
JavaScript
10
star
16

av1-demo

av1 encoding demo using svt-av1
JavaScript
9
star
17

chromium-win-arm64

Experimental dev builds of Chromium for Windows 10 ARM64
8
star
18

raw-to-mse

Experimental library for producing MSE-compatible buffers with uncompressed audio/video data
JavaScript
7
star
19

wasmosis

capability-passing "microkernel" for safely isolating WebAssembly modules
C
6
star
20

MediaWiki

PHP
6
star
21

svg-edit-test

SVG-Edit test tool comparing round-tripping of data files
JavaScript
6
star
22

emsdk-npm

emscripten SDK helper module for npm projects
JavaScript
5
star
23

statusnet-client

StatusNet Desktop and Mobile clients (mirror from Gitorious)
JavaScript
5
star
24

jpegxr

Rust wrapper for Microsoft's C JPEG XR codec library
C
4
star
25

mw-js-plugin

Experimental repo for MediaWiki JavaScript iframe-based plugin system
JavaScript
4
star
26

aomedia

work fork of aomedia - see http://aomedia.org/contributor-guide/
C
3
star
27

brot

Mandelbrot WebWorkers test
JavaScript
3
star
28

MediaWiki-MobileSidebar

mobile sidebar gadget
JavaScript
3
star
29

OEmbedConsumer

PHP
3
star
30

mediawiki-svn

A mirror of MediaWiki's Subversion repository produced with git-svn(1)
PHP
3
star
31

WLMTest

Development moved to https://github.com/wikimedia/WLMMobile
JavaScript
2
star
32

MediaWiki-ExtensionFetcher

Extension for MediaWiki to manage fetching extensions from git
PHP
2
star
33

WebM-iOS

iOS builds of libwebm
Ruby
2
star
34

density-bookmarklet

Experimental bookmarklet to swap PNG and SVG images to high-res on wikipedia
JavaScript
2
star
35

FlatRoller

HTML canvas game demo/tutorial/exploration
JavaScript
2
star
36

WebViewTest

quick Android webview test to see if text selection works
Java
2
star
37

ohgeevee

VR experiments with ogv.js and A-Frame
HTML
2
star
38

VPX-iOS

Local builds of libvpx for iOS
Makefile
2
star
39

CommonsMetro

Wikimedia Commons app for Windows 8/Windows RT
JavaScript
2
star
40

OEmbedProvider

PHP
2
star
41

cortado

mirror of old xiph cortado, for fun
Java
2
star
42

OgvRT

Experimental Ogg Theora/Vorbis player for WinRT (Windows 8.1 including RT and Phone)
C++
2
star
43

OGVKit-Specs

temp location of dependent CocoaPods specs for OGVKit
Ruby
2
star
44

EmbedScript

MediaWiki extension for safe embedding of locally-hosted scripts
PHP
2
star
45

WikipediaMetroTest

testbed for windows 8 metro integration features
JavaScript
1
star
46

orwel

OpenRaster Web Editing Library
JavaScript
1
star
47

EmbedTurtle

turtle graphics embedding test demo
JavaScript
1
star
48

turtle-world

Logo interpreter and turtle graphics environment for the web
JavaScript
1
star
49

MobileFrontend

MobileFrontend extension copy
PHP
1
star
50

gnome-system-monitor

Forked from master repo at http://git.gnome.org/browse/gnome-system-monitor/
C++
1
star
51

svg-test

SVG rendering test framework
JavaScript
1
star
52

EmbedPiechart

Experimental EmbedSandbox provider for drawing & editing pie charts
JavaScript
1
star
53

EmbedScriptSandbox

Sandbox page for MediaWiki EmbedScript extension
1
star
54

OLD-apps-win8-wikipedia

Wikipedia reader app for Windows 8/RT
JavaScript
1
star
55

CentralAuthAPI

MediaWiki API proxy for CentralAuth-connected wikis
PHP
1
star
56

test-emscripten-lib

C
1
star
57

WikipediaFrameTest

test of phonegap iframe issue on iOS
JavaScript
1
star
58

gnome-emscripten

Experiments at building GNOME low-level libraries for emscripten
C
1
star
59

EmbedSandbox

experimental MediaWiki extension for embedding remote scriptable objects safely
PHP
1
star
60

mozilla-SN---Plugin

Plugin for mozilla SN
PHP
1
star
61

operations-debs-ffmpeg2theorawmf

C
1
star
62

mandelbrot-shootout

Fractal programming language test demos
C
1
star
63

ffmpeg2theora

work fork of ffmpeg2theora
C
1
star
64

iframe-android-test

JavaScript
1
star
65

drive256

Drive256 - a VGA loadable driver experiment from 1992
Pascal
1
star
66

Vaders

HTML5 version of old DOS game
JavaScript
1
star
67

browser-transcode-test

Notes and experiments for browser-based transcoding of audio and video
HTML
1
star