Wednesday, January 27, 2010

VLC: Setting up a default directory.

So i was experimenting with the vlc remote app in the android market today and found it to be quite entertaining. Mind you i have never messed with a vlc remote before on any platform, so this was a new experience for me :]

Youtube video I created for this tutorial: http://www.youtube.com/watch?v=Kim5QM0nKfQ

I found it nice to control my whole media library during a party while lounging on my deck enjoying company from other party guests (yep...). However with this vlc remote it's quite tedious to always browse your computer on the phone in search of a particular file.

Solution 1 - Playlist method:
Put together a playlist of all your media and have it vlc load it by default at start up.

Disadvantages to solution 1:
1. Its a static list of your media which means you have to recreate the playlist every time you get some new stuff.
2. If you have 50,000+ song...making a playlist is not really efficent..not efficent at all. It also seems that vlc is buggy with playlist making and large number of files.

Solution 2 - Loading entire directorys semi-dynamicly:
This is semi-dynamic because it only updates. When vlc starts. To do this we actually need to make a custom playlist file that points to your desired directory and have it load when vlc starts.

The custom playlist file:
Fortunatly vlc uses the xspf format for it's playlist standard which is pretty straight forward. Here is what our custom playlist is basically going to look like
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/">
    <title>Playlist</title>
    <trackList>
        <track>
            <location>K:\</location>
        </track>
    </trackList>
</playlist>
So create a new text file and paste that into it. Replace "K:\" with whatever directory you want it to point to (can also be a folder) and save it as "playlistname.xspf"

Now once out playlist file is made we can now open up VLC - I'm using v1.0.3 (download latest) and configure VLC to automatically load this playlist when it starts.

Auto-load playlist:
1. Tools>Preferences (or simply CTRL-P)
2. Choose to show all settings (bottom left)
3. Playlist>"Default stream" textbox
4. Type the full location of the playlist file here. (i.e. C:\Program Files (x86)\VideoLAN\VLC\playlistname.xspf )
5. Save
6. Exit and reopen VLC and your directory should be queued in the VLC's playlist.

Ideas for using this:
1. Auto-load preinserted CD/DVD's
2. Semi-dynamic listing of contents of a folder, partition, memory card.

My VLC set up:
Auto-start VLC+http interface with windows>Auto-scan the DVD drive and queue found music>Auto-scan my media HDD and queue found media>control it via VLC remote on my phone>uploads recently played track's data to my last.fm account (so people at the party can check out my last.fm if they want to know what songs played). So my media library is ready to go basically right after logging into windows.

Perfect party solution!  :]

2 comments:

  1. Thank you very much for the tip.

    I was wondering if there is a way to tell VLC (when VLC is setup to read a default directory) to "exclude" certain types of file (ie: *.log, *.rar, avi ...)
    The reason is that I have, in my default music directory, lots of avi, log.
    I would like VLC only to read the types of file I want (ie: flac, mp3, wav, ....).
    Thank you

    ReplyDelete
  2. I think you need a file:/// before the k: and also in the stream reference.

    ReplyDelete