Notes: gather v0.3 Automagically build XML files and playlists for the Prismiq Media Server By Rob Flickenger, 9/19/03 (Yarrr!) Modified by Joel Schantz 10/25/2004 What is it? -=-=-=-=-=- The Prismiq is a nifty little hardware MPEG/MP3 decoder with a very open architecture. It runs Linux 2.4.18 (MIPS), and sports a 10/100 NIC *and* a PCMCIA slot for a wireless card (or other device? Muahahahaha...) It will play MPEG1 and MPEG2 videos natively (as well as MP3s), and can play many other formats by using a software transcoder. It will also display various image formats, and stream Internet radio. The fun part is that its only output device is your TV / Stereo system. As it has no storage of its own, the Prismiq requires a "Media Server" to operate. This is a computer somewhere on the network that has a pile of media and runs the Prismiq "Media Server" software. As of this writing, Linux support for the Media Server is pretty weak (it is a "preview" by their own description). While it will indeed serve media to your Prismiq, no effort is made to scan your server for media files. That's where this script comes in. The 'gather' script will recursively search a directory of your choice for all supported media types, and build the XML and media.map files that the Media Server hands to the Prismiq. As a bonus, it also builds automatic logical playlists for each media type (one playlist for each artist for your audio collection, and one for each subdirectory for images and videos.) Just run this script as often as you like, and it will keep your XML files in sync with whatever media you happen to have around. Requirements -=-=-=-=-=-=- * perl v5.6.1 * Chris Nandor's MP3::Info module * A Prismiq media player, http://prismiq.com/ * The Linux Media Server, http://prismiq.org/ This code has only been tested with Linux Media Server 4101_linux and Perl 5.6.1, but it should work with older Perl 5, and might even run on Windows with minor modifications. Installation -=-=-=-=-=-=- 1) Install the Linux Media Server and get it running first. 2) If you don't have the MP3::Info perl module, try this: # perl -e 'use CPAN; install MP3::Info;' Otherwise, go check http://search.cpan.org/ and download and install it manually. 3) Unpack the gather-X.X.tar.gz archive somewhere handy (say, /usr/local/prismiq/). 4) Edit the prismiq.conf according to the comments in the prismiq.conf file. You essentially have to get all of the paths right or nothing will work. See the comments in prismiq.conf for details. Running gather -=-=-=-=-=-=-=- You can run it manually from the commandline by simply typing: $ ./gather You don't have to run it as root, but be sure that you have write permission to the bin/gui directory under the Media Server installation. You should see something like: Processing....... It adds a . each time it processes 100 items. Eventually, you should see a nice statistics screen. If you'd like it to run quietly (say, from a cron job) run it with the -q switch: $ ./gather -q Also for summary help try ./gather -h To run it from cron, add an entry like this (hint: 'crontab -e'): 30 * * * * (cd /usr/local/prismiq/gather; ./gather -q) That will run it every half hour, which should be more than enough for most applications, although your mileage may vary(TM).
Changes: CHANGELOG (Was README.v2.PRISMIQ) ================================= Version 0.3 jschantz 10/25/2004 ----------------------------------- gather script -=-=-=-=-=-=- - removed need for perl module Net::Telnet (now uses IO::Socket) - removed filetype check from TestFile function (now done in GotOne function) - removed generation of tagfile name for mp3 files in media.map this disables mp3 tag file generation (Should be an option) - removed redundant? (Video) (Images) tag in generated playlists names - modified InitVerify to return connection - modified TestFile Function so filename escaping to be not so aggressive Now special characters (&<>'") are ONLY escaped in title for video and images of media.xml folder name used in playlist names artist, album, title tags for mp3 files This means Pathnames (valid or not) are NOT escaped in media.map - disabled path / to . translation in playlist name generation - disabled unused mp3info tags by commenting out - added hashname function for filenames to match "Windoze" method used in media.map, entry in playlist.xml, id/path/filename in media.xml - added ToXML function to clean up path/filenames for XML character escapes - added ability to prune named paths from scan tree (PrunePaths) - added filetypes to ignore during server TestFile verification (IgnoreTypes) - added auto generation/conversion of m3u playlists in a directory (PlaylistPath) - added use of tempfiles for media.map, playlist.xml, media.xml during generation - added media server query for media types (This will override settings in gather.conf if successfull) - added sortcolumn stuff to auto playlists - added printout to display media types - added command line option -s to print server GET_STATUS results - added command line option -l to select what type of auto playlists to generate a=audio, v=video, i=image New Command line options -=-=-=-=-=-=-=-=-=-=-=-= -l[avi] select media types for auto playlist generation (default is all) -s printout media server response to GET_STATUS gather.conf Changes -=-=-=-=-=-=-=-=-=- - added variable PrunePaths to allow for path names to ignore during scan - added variable IgnoreTypes to add list of filetypes to not test (with server) - added variable PlaylistPath for directory of m3u playlists to scan/convert Version 0.2 PRISMIQ, 10/29/2003 ----------------------------------- gather script for the PRISMIQ MediaServer for Linux, version 0.2 This script was created by Rob Flickenger to auto-find media and create data files formatted for the PRISMIQ MediaPlayer. This version merely changes the name of the configuration file to "gather.conf", and adds a sub routine that will query the MediaServer to determine if an audio or video file is playable. This version also adds lots of escaping of illegal characters in filenames and folder names, automatic lower-case comparisons of file types and filenames, as well as creating unique playlists per media type (see Tech Docs). also, symlinks are followed when searching. See http://nocat.net/~rob/prismiq/ for the original version. PRISMIQ, 10/29/2003
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use