Extensions in VLC
By Jean-Philippe André on Saturday, January 30 2010, 16:15 - VideoLAN - Permalink
A general introduction to VLC Extensions.
Starting with version 1.1, users will be able to write their own plugins for VLC, codenamed Extensions. The difference with other VLC modules consists in the language used to write these Extensions: Lua, a simple a lightweight scripting language, embbeded inside VLC media player.
Why extensions?
The success of Firefox over the past few years can be explained quite easily when you have a look at its main features. The major differences between Firefox and IE reside in the Open Source model, and the possibility for community users to write their own plugins. Some of these plugins, like AdBlockPlus, really change the way you enjoy the Web. As a consequence, you can't use any other browser, as long as you need your favorite Firefox plugins.
The same idea can apply to media players. With the constant progress of web technologies, you get more and more access to a lot of free content from your home computer. Why not binding this content with the software you love and the medias you watch or listen to? In less abstract terms, what if you could get the subtitles of the movie you are watching in less that one click, read the lyrics of the current track, learn about the artist's biography and discography right inside VLC?
Well, the answer is that you actual can. Just try VLC Extensions now and you'll see you can forget about your browser when it comes to multimedia-related content.
Okay, but what are extensions exactly?
Extensions are scripts running inside VLC, that will popup windows and fetch information on the web for you. To use an extension, all you need is to activate it from the View menu (if you are a Windows or Linux user). Then, it should be all self-explanatory.
Examples of possible (or actual) extensions include:
- Wikipedia: get information about the artist, the album or the movie from Wikipedia.
- IMDb: read the plot summary, learn about the cast of a movie and get a direct link to the Internet Movie Database.
- Last.fm: Read useful information fetched from the artist's page on Last.fm.
- Lyrics: Automatically get the lyrics of the current song.
- Subtitles: Find and insert subtitles on top of the video in two clicks.
- Concerts: Learn about the next concerts of this artist.
Obviously, if you have other ideas, I'd be glad to know about them!
Where do I start?
At the moment of writing, VLC 1.1 is yet under heavy development. Thus, in order to try these Extensions, you'll have to install a nightly build of VLC from http://nightlies.videolan.org.
Once this is done, you can find extensions here on the page Extensions for VLC. Download the Lua scripts and copy them to your VLC scripts folder:
- Linux: ~/.local/share/vlc/lua/extensions/
- Windows: %APPDATA%\VLC\lua\extensions
Launch VLC or open the Plugins & Extensions dialog to reload the list of extensions. Take a cup of coffee and enjoy!
Can I write my own?
Yes you can, but more details and tutorials will come later in another article. If you really want to get started now, read the README files and the example scripts provided. Remember you'll have to wait for VLC 1.1 before seeing them in you favorite media player.
PS: Comments have been disabled since I've received more spam than useful messages
Comments
Songbird already does this. It is the firefox of media players. Good start though. Will be nice to use extensions when using VLC>
I tired songbird but found it to be prone to crashing and it wouldn't play video, which is what I use VLC for. I would love a media library extension which would automatically add music and other media from specified folders. Would this be do-able in LUA?
wishlist:
1) (IIRC, a utility "mp3gain" can edit a file to change file's innate audio volume.) Hmm, googling now, I see vlc in this list http://en.wikipedia.org/wiki/Replay... so I guess i need only to find where to apply normalization in vlc? (and hopefully is also in portable vlc) This is very nice when playing short-length files of differing "innate" volumes, from a playlist. Kmplayer seems to have audio volume normalization, but I don't recall where i enabled this.
2) it would be nice if playlist commands were accessible while in playlist window (ie, when playlist window is active window). related: i think playlist save (in "file>" currently) should be in same menu as open playlist (in "tools>" currently?)
3) in winxp, dragging "shortcuts" (.LNK files) to playlists creates entries that "point" to only each LNK file, rather than following each LNK to "pointed-to" media file. However, "fixing" this would be windows-only, so not as useful as crossplatform features.
4) some type of link "healing" would be nice. i think in winxp this might be able to use one of the services (in services.msc, i think this service is TrkWks = Distributed Link Tracking Client, %WinDir%\system32\svchost.exe -k netsvcs)
a somewhat related "tip", for any player: i currently try to use the unc path to a media file, so when i later copy (or "merge", ughh...) playlists to other pcs, the path to each file is more likely to remain correct.
also, both vlc and kmplayer playlist files are text, therefore readily editable. and so, you can convert local paths to unc paths using text editor: use search&replace within playlist file.
(PS. thx to who[m]ever has|is writ(ten|ing) vlc... and to who[m]ever has written other great software..)
oooo sync with ipod please!!!!!!!!!!!!!!!!!!!!!!
Essential for me: film (by imdb) and music (by musicbrainz or last.fm) tagging. If you do this, i'll admire you forever :D
Although there is a frame-by-frame option in VLC, in some cases it will not display the next frame after the 7th or 8th click of the frame-by-frame button. I'd like to see an extension that would allow me to use frame-by-frame in all cases (especially helpful for analyzing a tennis stroke or guitar fingering).
Dan
Is this in the OSX builds yet?
You don't mention a default scripts dir for that platform, and I grabbed a nightly but can't find any 'Plugins and Extensions' dialog in the menus anywhere.
I'm running http://nightlies.videolan.org/build... and put http://jpeg.dinauz.org/VideoLAN/pat... into the unzipped nightly filetree ie vlc-1.1.0-git/VLC.app/Contents/MacOS/share/lua/extensions
... not clear how I can get this to show up or activate.
Problems aside, this looks like great work! Will LUA become the recommended way to write external remote controller apps? I'm exploring use of XMPP for remotes and haven't found a nice way to encapsulate VLC yet, so the LUA work seems promising for that.
Hello ^^ I bookmarked this site. Thanks heaps for this!… if anyone else has anything, it would be much appreciated. Great website Super Pianoforte Links
http://www.ed-hardy.cc ed hardy on sale
Enjoy!
Well, I tried it on Windows and now see that this is *not* yet in the recent OSX nightlies I was trying. And on Windows I haven't managed to get helloworld.lua to show up. Looking forward to an 'idiots guide' :)
Meanwhile, a question: lots of systems lately are using HTML/.js as an extensibility mechanism, eg. using W3C Widgets http://www.w3.org/TR/widgets/ ... is there any way to embed Web content via this Lua mechanism? ie. create a frame and populate it with html/.js content, and eventually perhaps reflect out parts of the Lua API into Javascript?
My mod of the subtitles extension is here: http://forum.videolan.org/viewtopic...