Giter Site home page Giter Site logo

ogvkit's Introduction

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

ogvkit's People

Contributors

bvibber avatar jamesrisberg avatar joenot443 avatar mstyura avatar triplef avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ogvkit's Issues

Player seems to leak memory / is not deallocated before video has stopped

When I remove a player view from its super view (and all other strong references to the object), the player seems to live on until the video has stopped (according to instruments' allocations instrument). Could this be because the dispatch queues still live on / keep themselves alive until the video stops? Also switching to a new sourceURL seems not to kill the previous video.

libtool not found

I’m getting the following results trying to compile on OS X 10.9.1 with Xcode 5.0.2 after installing autoconf and automake via Homebrew. It seems like autogen.sh is looking for libtoolize or glibtoolize, which don’t seem to be included with the iOS SDK. Any hints would be appreciated.

$ make
./buildFramework.sh \
      libogg \
      ogg \
      "i386 x86_64 armv7 armv7s arm64" \
      "" \
      "--disable-shared"
Building libogg...
Building libogg for i386
CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc
CXX=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++
CFLAGS= -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -arch i386 -miphoneos-version-min=6.0
/PATH/TO/OgvKit/libogg
./autogen.sh --host=i386-apple-darwin13 --prefix="/PATH/TO/OgvKit/build/libogg/i386" --disable-shared
checking for autoconf... 
-n checking for automake 1.11 or later... 
automake
-n checking for aclocal 1.11 or later... 
aclocal
-n checking for libtool... 
nope.

You must have libtool installed to compile libogg.
Download the appropriate package for your system,
or get the source from one of the GNU ftp sites
listed in http://www.gnu.org/order/ftp.html
make: *** [build/ogg.framework/ogg] Error 1

Memory leak in audio processing

There's a memory leak in audio processing; lots of NSInlineData objects get created and don't get freed while playing a file with audio.

Fix assembly for theora

Assembly has to be disabled for theora right now; check the VLC build scripts for how they make it work.

Video playback feels choppy/jerky

I think it's not waking up to show frames at the correct time when running on the audio clock, so we're waking only when the audio buffers run low (which is something like 11fps-worth).

Switch buffers to use CMSampleBuffer types

Instead of custom classes, try using the CMSampleBuffer types that AVFoundation uses. This should allow use of some system classes for things like reusing buffers, and make it easier to feed data between OgvKit and other stuff like the camera interface or H.264 decoding/encoding.

160p videos sometimes fail to play

Do they download too fast and we never get started? :P

2014-06-29 21:37:09.489 OgvDemo[6556:60b] 288 https://upload.wikimedia.org/wikipedia/commons/6/6c/Audiovisuals_centraal_op_onderwijs_tentoonstelling_Weeknummer_72-16_-_Open_Beelden_-_9386.ogv video/ogg; codecs="theora, vorbis"
2014-06-29 21:37:09.490 OgvDemo[6556:60b] 160 https://upload.wikimedia.org/wikipedia/commons/transcoded/6/6c/Audiovisuals_centraal_op_onderwijs_tentoonstelling_Weeknummer_72-16_-_Open_Beelden_-_9386.ogv/Audiovisuals_centraal_op_onderwijs_tentoonstelling_Weeknummer_72-16_-_Open_Beelden_-_9386.ogv.160p.ogv video/ogg; codecs="theora, vorbis"
2014-06-29 21:37:09.491 OgvDemo[6556:60b] 288 https://upload.wikimedia.org/wikipedia/commons/transcoded/6/6c/Audiovisuals_centraal_op_onderwijs_tentoonstelling_Weeknummer_72-16_-_Open_Beelden_-_9386.ogv/Audiovisuals_centraal_op_onderwijs_tentoonstelling_Weeknummer_72-16_-_Open_Beelden_-_9386.ogv.360p.webm video/webm; codecs="vp8, vorbis"
2014-06-29 21:37:09.492 OgvDemo[6556:60b] got OGVPlayerOpenMedia notification
2014-06-29 21:37:09.959 OgvDemo[6556:8bc7] Initializing playback!
2014-06-29 21:37:09.960 OgvDemo[6556:8bc7] Starting playback
2014-06-29 21:37:11.621 OgvDemo[6556:60b] done downloading

Cannot continue after pausing file with audio

Currently the audio doesn't properly stop or resume and the player logic doesn't expect it so it just stops. Grab logic based on ogv.js code for stopping/restarting audio timeline?

Fix aspect ratio regression

New OpenGL drawing code fills the entire view regardless of aspect ratio; should probably change the rectangle being drawn to match the proper display aspect ratio.

Hook up progress bar

Hook up the progress bar / slider -- initially just as a progress indicator, disable the sliding until seeking is available.

Crop output video

Video often requires slight cropping (eg show 640x360 subset of 640x368 file offset by 0x4 pixels). Currently we're showing the uncropped image on output.

Fix demo & playback on iOS 6

Demo has to be tweaked for build target to do ios 6. Some kind of crash getting an eagl context, need to poke it further.

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.