Re: [Hampshire] Streaming video

Top Page

Reply to this message
Author: Samuel Penn
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Streaming video
On Tuesday 27 January 2009 18:13:21 James Ashburner wrote:
> Samuel Penn wrote:
> > ...I use MediaTomb to stream audio and video to my PS3. Streams
> > full HD video just fine, but may not do what you want.


> I also use MediaTomb with a PS3 client and have found it to work very
> well. The only thing I've not worked out how to do is manually move
> files into different folders (list of media can get very long!). Does
> anyone know if this is possible or does it have to be scripted?


I've written a script to automatically sort videos according to
their structure on disk. There's some change you need to make
to the config.xml to enable custom scripts (I forget what), then
I modified addVideo() in /usr/share/mediatomb/js/import.js to
do the necessary logic.

Basically, it means you see the file system echoed structure on
the PS3, which may or may not be what you want. I have a fairly
sensible structure, so it works quite well.

The addVideo() code is below:


/**
 * Custom import for video, grab the whole hierarchy below the
 * '/opt/data/mpeg' root. This should allow a reasonably intelligent
 * layout in the client.
 *
 * Currently, there is no metadata on video items that we can use.
 */
function addVideo(obj)
{
    var location = obj.location.split('/');
    var chain = new Array('Video');


    var idx = 0;
    for (i=0; i < location.length-1; i++) {
        if (location[i] == "mpeg") {
            idx = i+1;
            break;
        }
    }
    for (; idx < location.length-1; idx++) {
        chain.push(location[idx]); //genre name  (Movies, TVShows, etc)
    }
    //chain.push(location[location.length-3]); //genre name  (Movies, TVShows, 
etc)
    //chain.push(location[location.length-2]); //series/movie name (Movie1, 
TVShow1,)
    addCdsObject(obj, createContainerChain(chain));
}



-- 
Be seeing you,                         http://www.glendale.org.uk
Sam.                        Mail/IM (Jabber): sam@???