Support > Applications
YAMJ on unRAID
limetech:
Download
Recently I've been helping a customer get YAMJ running on an unRAID server for viewing on a Popcorn Hour C-200. The result is very nice, so nice in fact, that I've replaced my own HTPC with a C-200! So I thought it might be useful to the Community to provide a package of everything you need to install YAMJ.
Following is the readme.txt file:
This package contains everything you need to install YAMJ on an unRAID Server
Version history:
0.1 - initial release
Package contents:
MediaInfo CLI for Linux version 0.7.33
Yet Another Movie Jukebox version 2.0 BETA release r1660
JAVA 2 Runtime Environment (JRE) version 6.0 update 11.
Assumptions
1. Your movies are all under a single user share called "Movies" (arranged in subdirectories is ok). If this is not the case, see section below, "Different Name of Movies Share". Also, this share should be accessible via the Popcorn Hour (a.k.a., PCH) via SMB protocol.
2. Your server name is "Tower". If this is not the case, you will need to edit the file My_Library.xml after step 3 below.
Procedure
1. Unzip the yamj_unraid.zip file to your PC and bring up your server's share list in a Network Places window.
2. Drag the 'extra' directory to the flash share.
3. Drag the 'YAMJ' directory to your Movies share.
4. If you have not modified your 'go' script, drag the 'go' file to the 'config' directory of the flash share, overwriting the existing 'go' file. If you have made modifications to your 'go' script, then you will need to examine the 'go' file and add those changes to your 'go' script.
5. From the unRAID console or telnet session, type this command:
/boot/extra/yamj-go
This command will install the run-time packages required for YAMJ (subsequently each time you reboot, you will not need to retype this command since it's invoked by the new 'go' script). It will also create a command called 'yamj-rescan' which you can use to update the YAMJ media information after adding new content.
You are now ready to invoke 'yamj-rescan' for the first time. Again, from the unRAID console or telnet session, type:
yamj-rescan
This runs the YAMJ application by invoking /mnt/user/Movies/YAMJ/My_YAMJ.sh (a shell script). Here's what will happen:
YAMJ will start scanning the Movies share for content (actually scans those directories specified in the My_Library.xml file - see below).
As it finds movies, it accesses the internet (mainly imdb.com, themoviedb.com, and thetvdb.com) to obtain metadata (movie details and artwork).
During this process it creates a directory called 'Jukebox' in the Movies share, and inside this directory is the generated metadata files, along with a number of html files which will comprise the YAMJ pages rendered by the PCH. At the end of the process it will also generate an index.htm file in the Movies share which is the root of the jukebox. The PCH has a feature, that if an 'index.htm' file exists in the root of a share, it's internal browser will render it instead of the usual flat file list - this is how the PCH can display the jukebox.
Design Notes and Tweaking
Because YAMJ scanning creates temporary files in the directory it's run from, you want it to reside on a hard disk, and not the Flash. Also, you don't want the generated Jukebox directory to end up on the Flash either. This is why you drag the YAMJ directory to the Movies share.
It's not strictly necessary to put the YAMJ directory in the Movies share; but, since the final Jukebox directory has to be in the Movies share, and the YAMJ creates temporary files in the YAMJ directory, and the drives need to be spun up to rescan the media, putting it in the Movies share is probably as good a place as any.
My_Library.xml and My_YAMJ.sh
These are files I created for YAMJ on unRAID, and are similar to those generated by Omertron's YAMJ_GUI_Config tool.
The My_Library.xml file contains xml-style descriptions of where YAMJ should look for media, and how the PCH will ultimately reference the media. Here is the default contents of this file:
--- Code: ---<libraries>
<library>
<path>/mnt/user/Movies</path>
<playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies</playerpath>
<exclude name="YAMJ/, Jukebox/"/>
<description></description>
<prebuf></prebuf>
<scrapeLibrary>true</scrapeLibrary>
</library>
</libraries>
--- End code ---
Again, this assumes the name of your movies share is "Movies" and the name of your server is "Tower". If either is different for your server, you must make appropriate changes in this file. (I believe these names are case-insensitive.) The 'exclude' string tells the scanner which directories and/or files to exclude from consideration.
It is also possible to have multiple entries in this file. For example, suppose in your Movies folder you have several subdirectories:
Movies/DVD
Movies/Blu-ray
Movies/Home-video
Movies/Other
Movies/YAMJ <-- the YAMJ application
Movies/Jukebox <-- generated by 'yamj-rescan'
You probably only want the DVD and Blu-ray directories to get scanned. In this case you could edit My_Library.xml to look like this:
--- Code: ---<libraries>
<library>
<path>/mnt/user/Movies/Blu-ray</path>
<playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies/Blu-ray</playerpath>
<exclude name=""/>
<description></description>
<prebuf></prebuf>
<scrapeLibrary>true</scrapeLibrary>
</library>
<library>
<path>/mnt/user/Movies/DVD</path>
<playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies/DVD</playerpath>
<exclude name=""/>
<description></description>
<prebuf></prebuf>
<scrapeLibrary>true</scrapeLibrary>
</library>
</libraries>
--- End code ---
Another way to do the same thing is this:
--- Code: ---<libraries>
<library>
<path>/mnt/user/Movies</path>
<playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies</playerpath>
<exclude name="YAMJ/, Jukebox/, Home-video/, Other/"/>
<description></description>
<prebuf></prebuf>
<scrapeLibrary>true</scrapeLibrary>
</library>
</libraries>
--- End code ---
My_YAMJ.sh
The My_YAMJ.sh script is used to invoke the YAMJ application and is set up to output the Jukebox directory and index.htm file to the Movies share. Here is the default contents of this file:
--- Code: ---#/bin/bash
# Include path to Java binary directory
PATH="$PATH:/usr/lib/java/bin"
# Change into YAMJ directory and execute the MovieJukebox script
# The -o option specifies where to put the generated index.htm and Jukebox directory.
cd /mnt/user/Movies/YAMJ ; ./MovieJukebox.sh My_Library.xml -o /mnt/user/Movies
--- End code ---
The PATH statement is necessary so that the java binary is found when the MovieJukebox.sh script is executed.
What I want to point out here is the output (-o) option. This is specifying where to put the generated index.htm file and Jukebox directory. Instead of '/mnt/user/Movies' you could explicitly select the disk, e.g., change to '/mnt/disk1/Movies'. Depending on how you have split-level set up, you might want to do this so that all output ends up on a single disk.
Different Name of Movies Share
If your movies share name is not "Movies" (e.g., maybe it's "Video"), I would recommend changing your share name to "Movies". If you insist on not doing that, then you need to edit My_Libary.xml and My_YAMJ.sh appropriately.
Automating 'rescan'
It might be nice to put 'yamj-rescan' in a cron job. This can be done by modifying your 'go' script to copy the 'yamj-rescan' command to the /etc/cron.daily directory for example. I have found this to be unnecessary since it's easy enough to telnet into the server and manually execute the command when new content has been added.
Future Changes
In a future unRAID release, I will add the ability to define a RAM disk that can integrate with user shares. With this feature, we can add a line to the 'yamj-rescan' script to move the Jukebox directory and index.htm file to the RAM disk. This will let us browse the Jukebox via PCH without spinning up any drives.
Another change would be to generalize YAMJ installation somewhat so that you can have multiple Jukeboxes. For example, as it's set up now, both movies and TV shows end up in the same Jukebox (and are accessed via the same share from the PCH point of view). But it would be straight-forward to be able to have multiple shares:
Movies
TVShows
HomeVideo
OtherVideo
Each of these shares could have it's own Jukebox & you would replace the PCH "home" page with a custom skin that let's you navigate to these shares separately.
Something else to point out... Suppose you have two separate shares, one called "DVD" and one called "BLURAY". You might think you can edit My_Library.xml like this:
--- Code: ---<libraries>
<library>
<path>/mnt/user/BLURAY</path>
<playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:BLURAY</playerpath>
<exclude name=""/>
<description></description>
<prebuf></prebuf>
<scrapeLibrary>true</scrapeLibrary>
</library>
<library>
<path>/mnt/user/DVD</path>
<playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:DVD</playerpath>
<exclude name=""/>
<description></description>
<prebuf></prebuf>
<scrapeLibrary>true</scrapeLibrary>
</library>
</libraries>
--- End code ---
This will NOT work because of a PCH limitation where only one share can be mounted at a time. When you navigate to the PCH 'Movies' share (in order to access index.htm), the PCH will have that share mounted internally. When you try to play a movie, it would require the PCH to also have BLURAY or DVD mounted. The result is that the move won't play.
Misc. YAMJ Notes
The forum over at networkedmediatank.com is a very good resource (obviously) for learning PCH and YAMJ, and customizing the skin. What follows are some observations made during process of getting this working on unRAID.
- Skinning: If you want to change the skin, for most skins what you do is download the skin directory and then copy that directory to Movies/YAMJ/skins. Next, find the file Movies/YAMJ/properties/moviejukebox.properties and copy it one level up (i.e., to Movies/YAMJ). Now you can edit this file and set the name of the skin to use. You will have to delete the Jukebox directory and recan all your media. You will probably also want to edit some of the skin properties files.
- File naming: The scanner is pretty good at identifying movies from the file name. There is documentation on what the file name convention should be to aide in this process (as well as correctly identify TV eipsodes) in the wiki section of the MovieJukebox code repository (code.google.com/p/moviejukebox/). This is the biggest pain in the neck: going through your collection and renaming titles so the correct metadata is picked up.
- Wrong metadata: Sometimes even if the file name is correct, YAMJ will still pick up the wrong metadata (either movie details, the artwork, or both). In this case there are a couple of approaches. If only the artwork is messed up or missing, you can download your own and place it in the move title directory. When YAMJ rescans, it will use this artwork instead of searching for it on the internet. If the movie details are wrong, or you want to tweak them, you will need to create what's called an "NFO" file. This is just an xml file (defined by the XBMC project) that describes the metadata. Again, if YAMJ rescans and finds an NFO file, it will use data contained therein instead of obtaining via internet. There are some PC-based tools you can download to create NFO files, for example Ember Media Manager (www.embermm.com/).
neilt0:
Thanks for building this. Very useful. I'd been meaning to get this running on my unRAID box, but never got round to it.
I found I needed to use "/boot/extra/yamj-rescan" as the command, as I wasn't usually in the correct directory.
Other than that, it seems to work well. I just had YAMJ scan all 372 Blu-ray movies on my server (16TB) in about an hour, and it built the Jukebox correctly.
I've just installed the Aeon Movie Wall skin and am re-scanning now.
neilt0:
--- Quote from: limetech on May 27, 2010, 02:39:21 PM ---Download
This will NOT work because of a PCH limitation where only one share can be mounted at a time. When you navigate to the PCH 'Movies' share (in order to access index.htm), the PCH will have that share mounted internally. When you try to play a movie, it would require the PCH to also have BLURAY or DVD mounted. The result is that the move won't play.
--- End quote ---
To get round this limitation, I mount other shares within the Movies folder. In my case, I'm actually mounting other servers in the folder, not shares from the same server.
I added the following to my go script:
--- Code: ---mount -o ro,nolock,tcp 192.168.0.16:/mnt/disk1/share/HD/Movies /mnt/disk1/Movies/LSLIVE
mount -o ro,nolock,tcp 192.168.0.16:/mnt/usbdisk1 /mnt/disk1/Movies/LSLIVE_usbdisk1
--- End code ---
I then edited My_Library as follows:
--- Code: ---<libraries>
<library>
<path>/mnt/user/Movies</path>
<playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies</playerpath>
<exclude name="YAMJ/, Jukebox/, LSLIVE/, LSLIVE_usbdisk1/"/>
<description>Tower</description>
<prebuf></prebuf>
<scrapeLibrary>true</scrapeLibrary>
</library>
<library>
<path>/mnt/user/Movies/LSLIVE</path>
<playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies</playerpath>
<exclude name="TV/"/>
<description>LSLive</description>
<prebuf></prebuf>
<scrapeLibrary>true</scrapeLibrary>
</library>
<library>
<path>/mnt/user/Movies/LSLIVE_usbdisk1</path>
<playerpath>file:///opt/sybhttpd/localhost.drives/NETWORK_SHARE/TOWER:Movies</playerpath>
<exclude name="YAMJ/"/>
<description>LSL_usbdisk1</description>
<prebuf></prebuf>
<scrapeLibrary>true</scrapeLibrary>
</library>
</libraries>
--- End code ---
I'm also going to set up YAMJ to scan the internal drives on my PCH C-200, but will change the playerpath attribute so that playback is still done locally on the PCH.
Joe L.:
--- Quote from: neilt0 on May 28, 2010, 05:55:57 AM ---I added the following to my go script:
--- Code: ---mount -o ro,nolock,tcp 192.168.0.16:/mnt/disk1/share/HD/Movies /mnt/disk1/Movies/LSLIVE
mount -o ro,nolock,tcp 192.168.0.16:/mnt/usbdisk1 /mnt/disk1/Movies/LSLIVE_usbdisk1
--- End code ---
--- End quote ---
Just be aware that you'll need to perform those "mounts" after unRAID starts, so you'll need some delay in the "go" script to make sure /mnt/disk1 exists before performing the remote mount.
Something like this might work
--- Code: ---emhttp &
for i in 1 2 3 4 5 6 7 8 9 10
do
if [ -d /mnt/disk1 ]; then
mount .....
mount .....
break;
else
sleep 10
fi
done
--- End code ---
It will try to perform the mount for 100 seconds. It will exit the "go" script if it fails to perform the mount after that time... but then something is probably wrong with the server file-systems to prevent it from starting.
And even more important, if you attempt to stop the server it will not stop because /mnt/disk1 cannot be un-mounted because it is busy. It will remain busy until you un-mount the two remote file-systems. at that time, the unRAID server will be able to stop the array. Currently unRAID has no "trigger events" to execute a script for un-mounting those remote file-systems before stopping the array.
Soon (hopefully) in unRAID 5.0, we will have "trigger events" where we can register the post-start "mount" commands and pre-stop "un-mount" commands to allow the server to start and stop with minimal manually typed commands. We do not have those events now unless you "simulate them" with a monitoring script of your own.
Joe L.
purko:
--- Quote from: Joe L. on May 28, 2010, 06:26:54 AM ---Soon (hopefully) in unRAID 5.0, we will have "trigger events" where we can...
--- End quote ---
With some luck we'll get those events sooner than that, as Tom indicated in this post:
--- Quote from: limetech on May 18, 2010, 12:19:38 AM ---Probably will be a 4.5.5 to add a couple drivers and some misc fixes. I can also throw in a few script call-outs as well.
--- End quote ---
Navigation
[0] Message Index
[#] Next page
Go to full version