YAMJ

From YobiWiki
Jump to: navigation, search

Contents

Intro

Another technique for Dune HD is to export movies library to external browsers rather than using the embedded dune_folder.txt mechanism.
My favorite is for now YAMJ a.k.a. MovieJukebox, with an adequate skin.
Big advantages are IMHO:

  • Solution cross-platform (while Dune HD specific solutions are all .Net not even compatible with Wine)
    • YAMJ is actually a Java CLI
  • Data easily exportable (while I had quite hard time exporting my data out of Zappiti)
  • Good old background/foreground unix principles: one data grabber (YAMJ) independent of the player and one frontend (a skin)
  • Manual changes to data grabbing performed with simple file-based annotations, so easily scriptable too

We'll see first how to use YAMJ for a Dune HD player, using the default skin: plain HTML
Then the promising iSkin2, smooth HTML targeted for tablets.
And finally eversion, flashlite to be run directly on the Dune HD

YAMJ with default skin

Actually I almost never use the remote control to navigate the media library directly on the DuneHD.
I prefer to do it either from the PC or from the Android tablet.
I tried eversion as skin (see below) but it doesn't work on the PC neither on DMC for Android so it doesn't really fit my need...
YAMJ produces directly HTML which is ok for the PC as we can control the DuneHD by HTTP requests and it's also ok for the tablet via a web browser (or via DMC as there is a script to convert YAMJ output to dune_folder structure as we'll see later).
But recently a new skin called iSkin2 is in development and can be tuned for the Dune HD as we'll see too in the next section.

Installation

I downloaded moviejukebox-2.8.zip from here
Some installation notes here I'm using several setups for parents & kids, here e.g. I'll create a "foo" setup.
Note that there is also a parental control in YAMJ but I don't use it as such.

library-foo.xml

Trick is to use Dune IP control in the URL
Example:

<libraries>
    <library>
        <path>/media/nas/video/</path>
        <playerpath>http://ip_of_dune/cgi-bin/do?cmd=launch_media_url&amp;media_url=smb://user:password@ip_of_nas/video/</playerpath>
        <exclude name="sample,tmp/,temp/,RECYCLE.BIN/,/._"/>
        <description>Movies</description>
        <prebuf></prebuf>
        <scrapeLibrary>true</scrapeLibrary>
    </library>
</libraries>

categories-foo.xml

It's a copy of categories-default.xml where I disable most categories, e.g. to keep it simple for my kid
Just change "<enable>false</enable>" into "<enable>false</enable>" for each category to suppress

moviejukebox-foo.properties

The main tuning file
Major stuffs:

# This is the skin property, you will need to change this if you want to change the look of YAMJ
mjb.skin.dir=./skins/default
# new yamj feature to enabled directory hashing layout for image storage.  Results in more speed on larger jukeboxes
mjb.dirHash=true
# Unix/Linux/Mac users will need to install Mediainfo on their own and remove the # from the front of this setting
mediainfo.home=/usr/bin/
# Set to true to have YAMJ monitor your settings and adjust overwrites as needed automatically for you.
mjb.monitorJukeboxProperties=true
# Create TV show Boxsets automatically (group all tv show seasons together as 1 show)
mjb.singleSeriesPage=true
# threading for speed
mjb.MaxThreadsProcess=3
mjb.MaxThreadsDownload=3
mjb.MaxDownloadSlots=.*=2,.*imdb.*=3,.*google.*=3,.*yahoo.*=3,.*themoviedb.*=4,.*thetvdb.*=2,.*apple.*=1

Personal settings

mjb.jukeboxRoot=/media/nas/Jukebox
mjb.libraryRoot=library-foo.xml
mjb.detailsDirName=Movies
mjb.xmlCategoryFile=categories-foo.xml

Reduce further indexes

# Comma-separated list of indexes to generate. Valid indexes include:
#  Other, Genres, Title, Certification, Year, Library, Cast, Director, Writer and Country
mjb.categories.indexList=Other,Title,Library,Set

IMDB/TVDB languages

imdb.site=fr
thetvdb.language=fr
#mjb.internet.plugin=com.moviejukebox.plugin.AllocinePlugin

MovieJukebox-foo.sh

Just MovieJukebox.sh with the proper options

#!/bin/sh
java -Xms256m -Xmx1024m -classpath .:./resources:./lib/* com.moviejukebox.MovieJukebox -p moviejukebox-foo.properties -c "$@"

Usage

Now we can run the tool:

./MovieJukebox.sh

Warning when editing XML files: if you get the following error when running the tool "The reference to entity * must end with the ';' delimiter" it's because URI must be html-escaped, e.g. replace & by &

Broken PLAY ALL

One broken thing is the "play all" button for series.
I'll have to convert the .jsp into proper .m3u playlists
and change in e.g. myserie.html

href="myserie S01E01.playlist.jsp"

into sth like

href="http://ip_of_dune/cgi-bin/do?cmd=launch_media_url&media_url=smb://user:password@ip_of_nas/video/myserie S01E01.m3u"

Meanwhile we can remove that button:

--- a/skins/default/skin-options.xsl
+++ b/skins/default/skin-options.xsl
@@ -48,8 +48,8 @@
 
 <!-- Detail Option #3: Where to show Play All link on the details page -->
 <!-- Valid values are: top, bottom, false/none, where top is now the default for movies -->
-<xsl:variable name="skin-playAllMovie">top</xsl:variable>
-<xsl:variable name="skin-playAllTV">bottom</xsl:variable>
+<xsl:variable name="skin-playAllMovie">none</xsl:variable>
+<xsl:variable name="skin-playAllTV">none</xsl:variable>

Force to fetch again default covers

We look for the default covers (well detection only based on filesize for speed reasons, use sha1sum if you want something more robust) in Jukebox and remove the corresponding movie XML file:

find . -size 20524c|awk '{sub(/.jpg/,".xml");sub(/\/.\/..\//,"/"); system( "rm \""$0"\";\n")}'

Add L' to sorting.strip.prefixes

For French, one missing article is "L'"
Edit skins/default/skin.properties:

# Sorting prefixes to ignore:
-sorting.strip.prefixes="A ","An ","The ","Le ","La ","Les ","De ","Het ","Een "
+sorting.strip.prefixes="A ","An ","The ","L'", "Le ","La ","Les ","De ","Het ","Een "

iSkin2

Read first the previous section if you don't know YAMJ with default skin.

iSkin is a YAMJ skin made for Webkit-based browsers on PC, iOS or Android (see here for a list of supported browsers, notably NOT Firefox)
iSkin2 is a development version for larger screens: tablets, PC...

Installation

Trying iskin2_preview5_zip_87752.zip from this post...

See readme file in the ZIP.

Main difference with what we did with the default skin is that iSkin2 requires to be installed on a HTTP server.
E.g. reusing lighttpd on my LaCie 5big Network 2 is largely enough.
For local tests "python -m SimpleHTTPServer" is also handy

Another difference is that we won't use explicitly the IP protocol within the library.xml file but we'll provide a specific Dune Javascript file to handle media URLs.

Download this patch file and apply it to iSkin2 files. It's a binary patch so you've to use git:

wget http://mediaplayersite.com/system/files/178-gfb107/iskin2_preview5_zip_87752.zip
unzip iskin2_preview5_zip_87752.zip
wget http://www.yobi.be/files/iskin2p5_dunehd.zip
unzip iskin2p5_dunehd.zip
git apply -p2 iskin2p5_dunehd.patch

Configuration is almost as usual:

skin-options.xsl

Let's configure skin-nmtList:

<!-- The URL for invoking the NMT Controller -->
-<xsl:variable name="skin-nmtList">Family Room:192.168.1.112:2,Bonus Room:192.168.1.104:2,Series 1:192.168.1.144:1</xsl:variable>
+<xsl:variable name="skin-nmtList">Dune:ip_of_dunehd_player:99</xsl:variable>

Third parameter (99) is actually not used for now.

library-foo.xml

Compared to the default skin, here no more Dune IP control trick in the URL, so back to a more YAMJ classic config:
Example:

<libraries>
    <library>
        <path>/media/nas/video/</path>
        <playerpath>smb://user:password@ip_of_nas/video/</playerpath>
        <exclude name="sample,tmp/,temp/,RECYCLE.BIN/,/._"/>
        <description>Movies</description>
        <prebuf></prebuf>
        <scrapeLibrary>true</scrapeLibrary>
    </library>
</libraries>

moviejukebox-foo.properties

As specified in the Readme:

# ****** Skin/jukebox settings ******
# This is the skin property, you will need to change this if you want to change the look of YAMJ
-mjb.skin.dir=./skins/default
+mjb.skin.dir=./skins/iSkin2

Known bugs

Known bugs of the Dune HD integration:

  • No "play all", no playlist support
  • RC popup layout a bit broken with Android default browser (but ok with Chrome on a PC)

Tips

To change the default home screen, navigate to the desired screen and press the star icon

Eversion skin

Many combinations are possible but to get it running on Dune, apparently Eversion + YAMJ is the proper way to go.
My scrap notes, note that I quickly moved to iSkin2 so they may be incomplete...

Resources

Installation

Get both tools in a combined archive from Eversion download page. I took aio_eversion_yamj_r0179c.zip. See also Github downloads page.
Unzip
Before you run yamj the first time, edit the dune_folder.txt file found in yamj/skins/eversion/interface to adjust the path. the path will be swf://(dune compatible path )/Jukebox/eversion.swf

apt-get install mediainfo

Edit moviejukebox.properties

  • uncomment mediainfo.home=/usr/bin
  • Add a link to the file where we'll describe sources: mjb.libraryRoot=library.xml
  • Add a link to the directory where we'll output the generated data: mjb.jukeboxRoot=/media/nas/Share/

Copy and adapt example-library.xml => library.xml, e.g. for a nas folder mounted locally and to be accessed by Dune over Samba:

<path>/media/nas/Share/video/</path>
<playerpath>smb://user:pwd@nas_ip/Share/video/</playerpath>

Usage

Now we can run the tool:

./MovieJukebox.sh

Quick way to test out the generated stuff:

wget -q -O - "http://dune/cgi-bin/do?cmd=launch_media_url&media_url=swf://smb://user:pwd@nas_ip/Share/Jukebox/eversion.swf"

It works but it's pretty slow on Dune HD

Pydun converter

Converts a YAMJ structure into a dune_folder, useful for Android DMC
Quite rough
YAMJ libraries need to get a name (description)
Still some bugs linked to UTF-8 handling

Misc YAMJ notes

YAMJ help pages

  • Some notes on proper filenames for movie detection
  • Yayman is a GUI for YAMJ but it's not clear what it does, it already renamed all my versionned files in lib/ :-(

YAMJ Filename conventions

Cheat sheet, much more details on YAMJ Wiki! Standard:

/Movies/My Movie.avi
/Movies/My Movie/VIDEO_TS/...
/Movies/My Movie/BDMV/STREAM/...
/Movies/My Serie/Season 1/My Serie S01E01.avi
#Special episode:
/Movies/My Serie/Season 1/My Serie S00E01.avi

Warning, it seems some chars are not supported in filenames: "&"
Separator: " ", "." or "_"

/Movies/My Movie.avi
/Movies/My.Movie.avi
/Movies/My_Movie.avi

Tokens: "[]" or "()"
With Year:

/Movies/My Movie.[YYYY].avi
/Movies/My Movie (YYYY).avi

With Language: (see moviejukebox.properties::filename.scanner.language.keywords.*)

/Movies/My Movie.[YYYY]_FR.avi
/Movies/My Movie.[YYYY]_FRENCH.avi

With video source (See supported keywords)

/Movies/My Movie_DVDRip.avi

Anything after "-" is ignored, usually used for episode title or part title, e.g.

/Movies/My Serie/Season 1/My Serie S01E01 - Title.avi

Trailers:

/Movies/My Movie [...Trailer...].avi
/Movies/My Movie [Bonus - Title of the bonus].avi

NFO:

/Movies/My Movie.nfo
/Movies/My Movie [PART1].nfo
/Movies/My Serie/Season 1/My Serie S01E01.nfo
/Movies/My Serie/Season 1/Season 1.nfo

Movie IDs (instead of using a NFO):

/Movies/My Movie [ID IMDB tt1234567].avi

Posters: replace movie extension by .jpg or .png or (see moviejukebox.properties::poster.scanner.coverArtExtensions)

/Movies/My Movie.jpg
/Movies/My Serie/Season 1/My Serie S01E01.jpg
/Movies/My Serie/Season 1/Season 1.jpg

Fanarts: idem with token .fanart (see skin.properties::mjb.scanner.fanartToken)

/Movies/My Movie.fanart.jpg
/Movies/My Serie/Season 1/My Serie S01E01.fanart.jpg
/Movies/My Serie/Season 1/Season 1.fanart.jpg

Banners: idem with token .banner (see skin.properties::mjb.scanner.bannerToken)

/Movies/My Serie/Season 1/My Serie S01E01.banner.jpg
/Movies/My Serie/Season 1/Season 1.banner.jpg

Videoimages: idem with token .videoimage

/Movies/My Serie/Season 1/My Serie S01E01.videoimage.jpg
/Movies/My Serie/Season 1/My Serie S01E02.videoimage.jpg

Multi-part: CDx, DISCx, DISKx or PARTx

/Movies/My Movie [DISC1].avi
/Movies/My Movie [DISC2].avi
/Movies/My Movie [DISC2-Title of part 2].avi

Trailers, bonuses, etc:
See filename.extras.keywords=trailer,bonus,extra

/Movies/My Movie [... Bonus ...].avi

Sets:

/Movies/My Movie [SET setname].avi
/Movies/My Movie [SET setname-order].avi
/Movies/My Movie [SET setname][SET otherset].avi
/Movies/My Movie [SET MySet].avi
/Movies/My Movie [SET MySet-3].avi
/Movies/Set_MySet_1.jpg # otherwise poster of first movie will be used for set
/Movies/My Serie/Set_My Serie_1.jpg
#Rem: setname="My: Set"? => "My$3A Set"

Excluding a directory:

/Movies/path_to_ignore/.mjbignore
#See also skip instructions in library.xml if used, e.g. *sample*, *tmp/,...

Flag as watched:

/Movies/My Movie.avi.watched

Massively flagging a directory as watched

find . -type f -not -name "*.jpg" -and -not -name "*.nfo" -and -not -name "*.srt" -exec touch {}.watched \;

Overlay XML

I had some troubles to activate overlays with the new OverlayXML feature, mainly putting the right stuff at the right place.
Here is how to add a "unwatched" ribbon to the thumbnail covers:

skin-user.properties

in the skin directory

thumbnails.xmlOverlay=true

overlay.properties

in the skin directory

thumbnails.xmlOverlayFile=overlay.xml
thumbnails.watched=true

You've to set to true each attribute you want to use in the XML overlay file, here just the attribute "watched".

overlay.xml

in the skin directory

<?xml version="1.0" encoding="UTF-8"?>
<overlay>
    <layer>
        <name>watched</name>
        <align>left</align>
        <valign>top</valign>
        <images>
            <image value="false" filename="unwatched_80.png"/>
        </images>
    </layer>
</overlay>

resources/unwatched_80.png

in the skin/resources directory
I used a scaled down and cropped version of unwatched.png seen here

Variations

Images you can affect: thumbnails, posters, banners and videoimages (and some footer?)
Beside "watched" there are a lot of other attributes you can use, but beware their name in properties and in xml are not always the same (e.g. logoHD <> HD)
See OverlayXML for a complete list.

Maybe a bug but for HD I couldn use "true" but "hd"

<images>
    <image value="hd" filename="hd.png"/>
</images>

Upscaling posters

I've a few posters too small.
YAMJ doesn't seem to be able to scale them up, so a quick script to fix that. Here we upscale to a minimum height of 525 pixels, larger images are untouched (see here for more info on the syntax):

mogrify -resize "x525<" *.jpg

or recursively, skipping SET posters (which are only for thumbnails)

find . -name "*jpg" -and -not -name "SET*jpg" -exec mogrify -resize "x525<" {} \;
Personal tools
Namespaces

Variants
Actions
Navigation
Tools