MobileVLCKit and VLCKit, part 1

This is part of an article series covering VLC’s Objective-C framework, which we provide to allow inclusion of all its features in third party applications as well as VLC for iOS and Apple TV.

Currently published:

VLCKit is a generic library for any audio or video playback needs on both Apple platforms and also supports streaming and media to file conversations on the Mac. It is open-source software licensed under the LGPLv2.1 or later, available in source code and binary form from the VideoLAN website. You can also integrate MobileVLCKit easily via CocoaPods.

The foundation of this framework was laid in 2007 by Pierre d’Herbemont as part of a Google Summer of Code student project, in fact kind of mentored by me. Since then, it played major roles in developing the Lunettes prototype in 2008/2009, MobileVLC in 2010/2011 as well as take-two of VLC for iOS in 2013 until present.

When do you need VLCKit? Frankly always when you need to play media not supported by QuickTime / AVFoundation or if you require more flexibility. You want to play something else besides H264/AAC files or HLS streams? You need subtitles beyond QuickTime’s basic support for Closed Captions? Your media source is not your mobile device and not a basic HTTP server either, but perhaps a live stream hailing from some weird media server or even a raw DVB signal broadcasted on a local network? Then, VLCKit is for you.

But this is open-source software right? What does this mean for me and the end-user? And wasn’t MobileVLC removed from the App Store in 2011 for some crazy licensing reason?

First of all, open-source means for you, that you get access to the whole stack. There is no blackbox, all the sources are there at your fingertips. No reverse-engineering needed, no private APIs.

Then again, this must not be the case for your software. The LGPLv2.1 allows our software to be included in proprietary apps, as long as you follow the license. As a start, make sure to publish any potential changes you do to our software, make sure that the end-user is aware that VLCKit is embedded within your greater work and that s/he is aware of the gained rights. S/he is granted access to our code as well as to your additions to our work. For further details, please read the license and consult your lawyer with any questions you might have.

Regarding the removal of MobileVLC, the world moved on a bit. libvlc and VLCKit are no longer under the GPLv2 but were relicensed to the LGPLv2.1. While this looks like a play on characters, it is of major importance regarding distribution on the Mac or iOS App Store. As of now, the Terms of Service of either store are still incompatible with the GPLv2 (despite major changes and improvements), while distribution under the LGPLv2.1 is absolutely permitted.

Let’s get going with a technical overview and start with a layer model:

Any layer can only communicate with the layer above and the layer below. Therefore, decoders are four abstraction layers away from the client app developer. Why is that a good thing? By having a decent amount of abstraction, it is no longer necessary for you to know which library is taking care of the decoding, rendering or parsing. You are wondering whether you need to decode your certain video in a multi-threaded or single-threaded way, think that decoding might be accelerated through the hardware in the iPhone 5S and above, but pondering what to do with older releases? libvlc will do the correct thing for you.
However, we allow flexibility. You know that you want to use a certain option on libavcodec because it’s cool (and for some reason, we decided against it?)? that’s a one-liner for you.

Okay, so how do you get going? Have a look at the SimplePlayback sample code available for download here. Ignoring the boilerplate code present in any empty iOS app project, this basic app shows you how to play a video in 8 lines of code and to allow the user to play or pause playback:

@interface RandomViewController ()
{
    VLCMediaPlayer *_mediaplayer;
}
@end
@implementation RandomViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    /* setup the media player instance, give it a delegate and
     * something to draw into */
    _mediaplayer = [[VLCMediaPlayer alloc] init];
    /* assign a random UIView or NSView to the player to
     * draw the video */
    _mediaplayer.drawable = self.movieView;
    /* create a media object and give it to the player */
    _mediaplayer.media = [VLCMedia mediaWithURL:
     [NSURL URLWithString:@“http://yourserver.com/folder/file.mkv“]];
}
- (IBAction)playandPause:(id)sender {
    if (_mediaplayer.isPlaying)
        [_mediaplayer pause];
    [_mediaplayer play];
}
@end

Give it a spin!

Then again, chances are that you are on iOS and you want to have a slightly more advanced user experience. Need a seek slider and a time display or would you like to crop the video a bit? Your media includes more than one audio or subtitles track and the user should be able to switch? The code is there for you. We wrote a self contained class and distribute it under the BSD 2-clause license. If you are interested, checkout the Dropin-Player project available here.

That’s it for the first part of this article. The second part will cover more advanced use-cases of VLCKit and will follow shortly.

If you have questions, don’t hesitate to use the comment section or to shoot a mail.

One last word regarding VLC for iOS and taking code from that project. A contrario to VLCKit or the provided sample code, it is protected by different licenses and different obligations. It is dual licensed under the GPLv2 as well as the MPLv2. Most importantly, it is absolutely not permitted to take any bits of code it unless your product is distributed under a compatible license. We have a good DMCA track record and we are monitoring both the Mac and the iOS App Stores constantly.

upnpx 1.3.0

When I started to work on VLC for iOS last summer, it quickly became apparent that it would need to support playback from local media servers announced over the UPnP protocol. I came across a Objective-C++ library named upnpx which suited my use case nicely and which included broad support for all the various UPnP dialects.

Regrettably, upnpx was not maintained anymore since a few months, so I started a private fork within VLC for iOS and eventually moved on to github. Nowadays, my fork is officially endorsed by the original developer Bruno Keymolen.

This week, I did a first release of upnpx since the fork. Version 1.3.0 includes full support for iOS 8 and the 64bit runtime as well as fixes to a lot of logical runtime bugs and crashes. Additionally, it adds new APIs for MediaServer1ItemObject, BasicUPnPDevice, as well as server notifications.

I’m particularly happy about the fact that 8 people contributed to this fork and several hundred people are deploying it in their apps.

So, please get the tarball or add it through CocoaPods, deploy it in your app and report any issues or feature requests you might have!  Let’s see where this goes!

VLC media player for Mac OS X, versions 2.1.4 and 2.0.10


Today, we released 2 versions of VLC media player for Mac OS X targeting different client systems.

Version 2.1.4

This is a small bug fix release, which improves an important regression regarding DVD playback and improves compatibility with HUffYUV contents by upgrading the respective decoder library. Additionally, a rare issue with some specifically crafted wmv files was fixed and a misleading error message no longer appears during video playback on OS X Mavericks.
Grab a copy here or trigger the internal updater if it doesn’t prompt you right away.

Version 2.0.10

More than 3 months after the last update to VLC’s 2.0 release series, this minor update includes security updates for third party libraries, stability improvements and increased battery life when using a Mac with more than one graphics card.
While we generally recommend anyone using a Mac with OS X 10.6 or later on a 64bit-capable device to deploy version 2.1.4 linked above, VLC 2.0.10 is a great thing to enjoy your media if you decided to stay on OS X 10.5 or if you are using a PowerPC or 32bit Intel-based Mac.
Fetch the PowerPC binary here or grab the Intel variant there. The update is also appearing in VLC’s internal updater.

VLC for iOS, version 2.2.1

Today, we released a small update of VLC for iOS. It solves the most important regressions in last week’s 2.2 major release, but also includes a major improvement: full initial support of 64bit aka AArch64 aka arm64 on late 2013’s iPhone and iPad thanks to a close collaboration with the libav team.

Additionally, we added enhanced support for a broader set of UPnP servers, notably Twonky 7, Serviio 1.4 and XMBC 12, and resolved an inconvenient memory management issue in the underlying upnp library, which lead to the weird behavior that from a full folder only a single file would actually be played over and over again.

Regarding VLC for iOS’ networking capabilities, the option to manipulate the caching level was implemented in the same way as known from its desktop counterparts. Furthermore, ftp streams respect non-ASCII file encodings and URLs with spaces correctly now. Streaming from Dropbox is more reliable, too.

Finally, we increased the readability of metadata displayed on iPad (iOS 7), solved stability regressions on iOS 6 and implemented a more intelligent thumbnailing mechanism.

Oh, and your TV show episodes disappeared with the last update? That’s solved, too. Sorry for the confusion and the trouble this database edge-case caused.

VLC for iOS, version 2.2

Today, we published version 2.2 of VLC for iOS on the App Store. It features a re-designed interface for iOS 7, which we demonstrated in early November last year.

Since then, we took the time for further improvements, polishing and most importantly adding features in addition a plain restyling.

Notably, we added the following:

  • Google Drive integration and Dropbox streaming,
  • New multitouch gestures,
  • Improved library for TV Shows and Audio,
  • Better UPnP integration, with downloading support,
  • A startup tutorial,
  • New streaming formats and protocols supported,
  • Rewritten WiFi upload,
  • Improved privacy when using Passcode Lock

Additionally, we performed a lot of tweaks and minor improvements on the interface, which are also reflected in the legacy iOS 6 UI (yes, we still fully support it!):

  • Improved feedback for media download progress including data bitrate, procentual progress and estimated remaining download time
  • Opening network streams no longer leads to a collapsed file system hierarchy on the remote system. After playback, you can continue where you left off.
  • Added bookmarks for FTP servers
  • Previously removed episodes and tracks no longer show up in the respective group listings (#9705)
  • Improved privacy by requesting the passcode immediately after leaving the app and by obfuscating playback metadata if passcode lock is enabled
  • Added support to endlessly repeat the currently playing item (#9793)
  • Added option to disable file name display optimizations (#10050)
  • TV Shows are sorted by Season number / Episode number and Music Albums respectively by track number
  • Added ability to rename any media item in the library view
  • Added deletion of multiple media items in one step
  • Improved TV Show handling for shows with more than 100 episodes
  • If your media was recognized as part of a music album, the next track will automatically start playing afterwards
  • New translations to Czech, Malay, Persian, Spanish (Mexico)

Furthermore, we worked on details of all kinds of network interaction supported by VLC for iOS:

  • Improved UPnP stability and new support for downloading files from supported servers
  • Added cover-art and duration to UPnP server item lists
  • Fixed displayed size for files stored on UPnP multimedia servers larger than 2147.48 MB (#9641)
  • Dramatically improved WiFi upload reliability during concurrent or repeated sessions
  • Added support for HTTP Live Streaming (HLS) (#9174)
  • Added support for https playback
  • Added support for system-wide HTTP proxy settings
  • Added support for m3u streams
  • Improved vlc:// custom protocol handling (#9542)

We hope that you with love this new version as much as we do. You can find detailed usage documentation on the VideoLAN wiki.

VLC for iOS is fully developed by volunteers in their spare time. If you would like to contribute in one way or another, please check VideoLAN.org.

In case you are interested in embedding our underlying technology as a simple framework to your own iOS or OS X app, have a look at the VLCKit wiki page and get in touch.

 

VLC 2.1

Today, we published VLC media player 2.1.1 for all major desktop operating systems. If you used VLC for Android or for iOS in the last couple of months, you already got in touch with VLC’s 2.1 code base.

VLC media player 2.1 was initially published on September 26. However, we didn’t enable VLC’s internal updater since then. Why? We spent extra time on polishing the release, added support for the upcoming major video codec HEVC aka H.265 in MKV and MP4 containers as well as raw files, and lastly improved compatibility with both OS X 10.6 and 10.9.


2.1 is a major release for us, something we worked on since September 2011. We took the time to entirely re-write VLC’s audio output structure resolving architectural issues, improving lip synchronization, enhanced efficiency and improved device management. On the Mac, this upgrade also adds full support for external audio output devices and 6.1 / 7.1 / 8.1 / 10.2 multi-channel layouts.

On OS X, we finally added support for hardware-accelerated H.264 video decoding with further improvements including support for MPEG 2 and H263 scheduled for this winter season. Furthermore, video capturing using AVFoundation is supported on OS X 10.7 and later as well as recording the current screen contents, a feature previously supported on 10.5 and 10.6 only.

VLC 2.1 completes the transition to our re-written Mac interface introduced in version 2.0 with various major improvements, further customization options including additional playlist columns, support for cloned and split video output windows, as well as customizable presets for video filters, audio filters, and the equalizer. A new “Subtitles” menu embraces VLC advanced compatibility with any textual or bitmapped format and allows the user to customize text styles and size on-the-fly during playback. An all-new “Convert/Stream” panel simplifies media to file conversations as well as setup of streams on the local network or the internet. The media library and playlist view gains full Podcast support known from our ports to Windows and Linux.

Those major improvements have a drawback though: VLC 2.1 no longer supports any 32bit Intel-based Macs and any PowerPC-based Macs. It requires OS X 10.6 or later. For the older  Macs, we published another bug fix release last week, 2.0.9, fixing various annoyances and resolving all known security issues. Macs compatible with VLC 2.1 will be offered the update automatically while the others will remain on 2.0.9 with the potential option for a future 2.0.10 release, should it be needed.

We have great news for developers: VLC’s underlying work-horse, libVLC, as well as most of its modules were relicensed to LGPLv2.1+. This allows any interested party to deploy our proven code their own apps and solutions. As showcase apps, we developed VLC for Android and VLC for iOS demonstrating libVLC’s features. While libVLC is a C library, an all-Objective-C framework named VLCKit is available for Apple platforms. Native Java bindings are available for Android, too.

We hope you enjoy VLC 2.1 as much as we do and we are looking forward to further releases in our pipeline on track for release this winter.

VLC for iOS 7, preview

Over the last weeks, I worked closely with Damien Erambert on VLC’s user interface on iOS, rethinking it for iOS 7.

I would like to share a small preview today with further iterations pending. Version 2.2 of VLC for iOS will also include various new features and refinements. More on that, at a later point.

Any feedback and remarks are strongly welcome.

VLC for iOS, version 2.1

About 8 weeks passed since the initial re-release of VLC for iOS based upon its entirely re-written code base. Its success outperformed our expectations with more than 2.5 million downloads during the first week. Wow!

For the first major update, we listed carefully to the feedback received on the App Stores and through others channels.
It adds the following features and improvements:

  • Improved overall stability
  • Newly implemented menu and application flow
  • Added support for subtitles in non-western languages
  • Improved Subtitles support with options to choose font, size, and color
  • Add basic UPNP discovery and streaming for HTTP servers
  • Add FTP server discovery, streaming and downloading
  • Add Bonjour announcements for the WiFi Uploader’s website
  • Add playback of audio-only media
  • Improved VoiceOver and accessibility support
  • Added Deinterlace option (off by default)
  • Device no longer goes to sleep during media downloads
  • Improved video output on external screens
  • Improved Passcode Lock behavior
  • Minor usability improvements
  • New translations to Bosnian, Catalan, Galician, Greek, Marathi, Portuguese,
    Slovenian

Additionally, we took the time finish a complete walkthrough of the app to discover what’s actually included and to answer most questions.

At present, the update is being processed by Apple for the App Stores and will be available in your local store within a few hours from now.

We are looking forward to your feedback and to our scheduled forthcoming releases, which will add WebDAV support, multi-touch gestures and so much more!

VLC for iOS 2.0

So there we are. We have come a long way. Today, it’s my pleasure to announce that VLC for iOS is back on the App Store. It’s available free of charge in any country, requires iOS 5.1 or later and runs on any iPhone, iPad or iPod touch.

This is more than an upgrade of the initial version: it’s a full re-write. From the ground-up. Relying on the power of MobileVLCKit and its underlying libvlc, we started with modern video and audio output modules offering faster drawing, full support for 10bit H264 encodings, retina displays and lower latency.

On top, we started from scratch. While the UI offers all the functionality you might remember from the initial version, we did not stop there. We added multiple ways to sync media, video filters and playback speed manipulation, support for subtitles including Closed Captions and complex SSA, playback on external screens or AirPlay, and of course native support for multiple audio tracks and background audio playback as well as passcode lock.

Depending on your App Store’s time zone, it will be available here.

Let us walk through the features and let’s start with:

Media Synchronization

WiFi Upload

When switching a toggle in the VLC menu, a URL will appear. Entering it in a web browser on your PC or Mac will reveal a file upload mechanism. You can choose your files with an ordinary picker or just drop them in the browser. It will automatically upload the media to your iOS device and allows parallel operations. You can start playback on the device as soon as upload started. No need to wait until it is complete.

Dropbox

VLC for iOS offers native Dropbox integration. After login, you can browse all your files and folders to download media to your device for offline playback. Integration with further clouds such as Google Drive or Microsoft Skydrive is scheduled for subsequent releases.

Download from Web Server

VLC for iOS allows you to download files from any web server and scheduling should you choose to download multiple files at a time.

Network Streams

VLC for iOS includes the ability to play any network streams support by VLC media player for desktop operating systems, be it locally served or provided through the cloud. It will remember your last 15 streams and offers a private mode, too.

iTunes File Sharing

Like the initial port to iOS, you can attach your device to your Mac or PC and use iTunes to fetch or put files.

3rd party app integration

Any app including a “Share” dialog can use VLC for iOS for media playback. You will be prompted if you’d like to keep a copy in its media library or not.

Media Library

Your media collection. It offers basic information about each file, such as length, resolution, or file size. Your last playback position is visualized through an orange triangle at the bottom of the snapshot, unless it’s new or fully played.

Playback

The controller panel provides access to basic playback controls, a video filter panel, audio and subtitles track selection as well as playback speed.

The time slider a the top of the playback screen matches the default media player behavior by allowing you to seek at the pace you want. Next to it, you will find a 2-mode time counter and a button to control aspect ratio and cropping.

Video Filters

Like VLC media player on desktops, VLC for iOS allows you to modify the video’s colors in real time. Brightness will adapt your device’s physical luminance unless you play your media on an external screen, where it will fallback on a software mode.

Licensing

VLC for iOS is fully open-source. You can fetch its code online, modify and redistribute it following its bi-licensing under both the Mozilla Public License 2.0 and the GNU General Public License Version 2 or later.

MobileVLCKit and MediaLibraryKit are licensed under the GNU Lesser General Public License Version 2.1 or later, which allows you to build your own playback applications based upon our engine. Launch partners include ROTAPP and Korrisoft.

We will publish a SDK along with VLC media player 2.1 for desktop this summer. Both frameworks can be adapted to your needs. If you need assistance, you are more than welcome to get in touch.

Thank you

VLC for iOS wouldn’t have been possible without major support by the VideoLAN association, which sponsored devices and trips to meet with geeks and major cooperations, invaluable help provided by Gleb Pinigin who wrote a fifth of the app, Jean-Baptiste Kempf for sharing his insights during conception, regarding legal implications and for insisting on WiFi File Sharing, Pierre d’Herbemont, the original author of VLCKit and MediaLibraryKit, which lay the base for this project to great lengths, Jean-Romain Prévost for stepping-up for the Web Interface, Damien Erambert (once again!) for the UI design as well as Romain Goyet from Applidium for finishing touches and final suggestions.

Furthermore, a huge thank you to Freya Lindhorst for providing the freedom to devote so many nights on this project as well as Helena Arndt, Luca Barbato, Ana Coronel, Keiji Costantini, Ludovic Fauvet, Roberto Ferraro, Christian Kosim, Adrien Maglo, Ilkka Ollakka, and Alexandre Perraud for tests, ideas and translations.

You are terrific.

VLC 2.0.7 out now

Today, we published VLC 2.0.7. This is an important update to VLC’s 2.0 series, which improves the overall stability, fixes minor annoyances and solves certain security implications.

It will be available through the internal updater on Mac OS X later today and is already live on our main website for manual downloads. The in-app announcement on Windows will be enabled as soon as the load on our servers allows.

Notable changes include:

  • Fix playback termination when switching ES tracks (PowerPC only)
  • Fix WMA Pro, MPEG 4 ALS, APE, MLP and ADPCM-IMA4 playback
  • Fix audio encoding for numerous codecs, notably mp3 and AAC

Included security content:

  • Fix memory exhaustion vulnerability when playing specifically crafted playlist files
  • Fix two xss vulnerabilities (CVE-2013-3565)

Further improvements:

  • Fix crash when using libvlc in 3rd party applications (Mac only)
  • Minor improvements to the OS X interface
  • Fix issue which could lead to loss of media files created through transcoding on OS X
  • New translations to Azerbaijani, Kirgyz, and Oriya
  • Updated translations to Basque, Simplified Chinese, Ukrainian, Turkish, Portuguese, Norwegian Bokmål, Burmese, Lithuanian, Italian, Hindi, Spanish, German, Czech, Danish, and Welsh