IOS: Difference between revisions

From XiphWiki
Jump to navigation Jump to search
(+JavaScript see also link)
(→‎Related projects: update link to ogv.js)
(5 intermediate revisions by the same user not shown)
Line 5: Line 5:
Experimental work in progress script to build the libraries to .framework bundles that can be easily linked to in an Xcode project: https://github.com/brion/OgvKit
Experimental work in progress script to build the libraries to .framework bundles that can be easily linked to in an Xcode project: https://github.com/brion/OgvKit


== Notes ==
=== Notes ===


* uses existing autoconf build infrastructure; scripts wrap autogen.sh with appropriate settings, then combine the build products into framework bundles
* framework bundles each contain a 'fat binary' library with armv7, armv7s, arm64 for devices and i386, x86_64 for simulator, plus a subdirectory with the C headers
* libtheora
* libtheora
** Must pass --disable-asm, as the asm code doesn't build for iOS (yet?) [https://gist.github.com/brion/7345164 errs]
** Must pass --disable-asm, as the asm code doesn't build for iOS (yet?) [https://gist.github.com/brion/7345164 errs]
== Performance ==
See preliminary benchmarks at https://github.com/brion/OgvKit/wiki/Device-notes


== OS integration ==
== OS integration ==
=== Native codecs ===
<span style="color:red; font-weight:bold">NO</span>


iOS's native media framework is [https://developer.apple.com/av-foundation/ AVFoundation], which unfortunately is not extensible with codec or file type plugins. :(
iOS's native media framework is [https://developer.apple.com/av-foundation/ AVFoundation], which unfortunately is not extensible with codec or file type plugins. :(


It should be possible for an Obj-C wrapper library to use the same audio and video buffer types for input/output as AVFoundation does, however, which will make it easier to hook them up together for transcoding or live encoding from the camera.
It should be possible for an Obj-C wrapper library to use the same audio and video buffer types for input/output as AVFoundation does, however, which will make it easier to hook them up together for transcoding or live encoding from the camera.
=== File type handler ===
<span style="color:green; font-weight:bold">YES</span>
It is possible for an app that plays Ogg media to register its file types with the system, allowing other apps that may download files (Safari, Mail, Dropbox, etc) to prompt to open them in the player.
I have implemented an early test of this in OgvKit demo player; it works but, for instance Safari will download the entire file and '''then''' hand it off to the player, so you cannot play during the download.
=== URL handler ===
<span style="color:orange; font-weight:bold">YES, BUT</span>
It is possible for an app that plays Ogg media to register a URL handler, which would allow other apps or web content to launch the player. A remote URL could be included as a parameter on that URL, allowing apps or web content to hand off something to download-and-play progressively.
Unfortunately you can't do something like register for 'http[s]://*/*.ogv' -- you can only register a scheme such as 'x-ogvkit-player'. So you can't accept arbitrary HTTP or HTTPS links; the calling app or web content needs to know your app-specific URL scheme.


== Related projects ==
== Related projects ==


* [[JavaScript]] codecs
* [[ogv.js]] JavaScript codec works in iOS Safari
* [https://wiki.videolan.org/VLCKit/ MobileVLCKit] wraps many codecs including the main Xiph ones, and has a high-level player interface


{{DISPLAYTITLE:iOS}}
{{DISPLAYTITLE:iOS}}

Revision as of 14:48, 18 March 2014

At least libogg, libvorbis, and libtheora build and run on iOS without modification in their current incarnations.

Building

Experimental work in progress script to build the libraries to .framework bundles that can be easily linked to in an Xcode project: https://github.com/brion/OgvKit

Notes

  • uses existing autoconf build infrastructure; scripts wrap autogen.sh with appropriate settings, then combine the build products into framework bundles
  • framework bundles each contain a 'fat binary' library with armv7, armv7s, arm64 for devices and i386, x86_64 for simulator, plus a subdirectory with the C headers
  • libtheora
    • Must pass --disable-asm, as the asm code doesn't build for iOS (yet?) errs

Performance

See preliminary benchmarks at https://github.com/brion/OgvKit/wiki/Device-notes

OS integration

Native codecs

NO

iOS's native media framework is AVFoundation, which unfortunately is not extensible with codec or file type plugins. :(

It should be possible for an Obj-C wrapper library to use the same audio and video buffer types for input/output as AVFoundation does, however, which will make it easier to hook them up together for transcoding or live encoding from the camera.

File type handler

YES

It is possible for an app that plays Ogg media to register its file types with the system, allowing other apps that may download files (Safari, Mail, Dropbox, etc) to prompt to open them in the player.

I have implemented an early test of this in OgvKit demo player; it works but, for instance Safari will download the entire file and then hand it off to the player, so you cannot play during the download.

URL handler

YES, BUT

It is possible for an app that plays Ogg media to register a URL handler, which would allow other apps or web content to launch the player. A remote URL could be included as a parameter on that URL, allowing apps or web content to hand off something to download-and-play progressively.

Unfortunately you can't do something like register for 'http[s]://*/*.ogv' -- you can only register a scheme such as 'x-ogvkit-player'. So you can't accept arbitrary HTTP or HTTPS links; the calling app or web content needs to know your app-specific URL scheme.

Related projects

  • ogv.js JavaScript codec works in iOS Safari
  • MobileVLCKit wraps many codecs including the main Xiph ones, and has a high-level player interface