Saturday, August 25, 2012

Integrating Mythtv and Plex/XBMC

There is not native Mythtv support in Plex as of the writing of this blog post.  However, Plex contains xbmc code that can play Mythtv's transcoded .nuv NuppelVideo files. I transcode mpeg2 files to nuv to save on disk space.  XBMC has mythtv integration but scanning of tv shows doesn't always work and it's sometimes days or weeks behind in updating the tv shows and episodes.

Mythtv also does not name the files in a format that plex and xbmc scrapers can use to help identify the episode.  Hell On Wheels.s02e02.mpg looks something like 5066_20120825091500.nuv on the mythtv side.

The recipe for integration calls for:

MythicalLibrarian -
SMB/CIFS share of your mythtv recordings or where you link your mythtv recordings via MythicalLibrarian.

Follow the instructions for downloading and installing MythicalLibrarian on the following site:

Easy installation:

sudo apt-get install curl && mkdir ~/.mythicalLibrarian && mkdir ~/.mythicalLibrarian/mythicalSetup && cd ~/.mythicalLibrarian/mythicalSetup
sudo su
chmod +x ./ && ./

I made 3 modifications to the default settings in the file.

I set the MoveDir= to a directory where I would make a samba share just for mythtv linked recordings.

I set  the SYMLINK=LINK  to symbolically link the nuv to the mpeg file created by the mythicalLibrarian script.

I also added the ip addresses of my xbmc frontends in the XBMCIPs=( '192.168.x.x:8080') section.

When the script finished it will add a user job to mythtv to automatically run for new recording schedules. A few modifications will be needed to modify existing recording schedules.  I'll show you how to do that shortly.

I had years of recordings that I needed to scan and identify so I let the script run over 3 days to identify all my shows in a format the plex and xbmc could understand.

mythicalLibrarian --scan nuv /home/mythtv/Videos

Once that was complete I added the following share to my samba configuration file.  (/etc/samba/smb.conf for me in linux) and restarted samba for it to take effect.

        comment = Tv
        path = /home/mythtv/Videos
        writeable = yes
        browseable = yes
        create mask = 0775
        force create mode = 0664
        directory mask = 0775
        force directory mode = 0775

sudo service smb restart

I added the directory /home/mythtv/Videos as a tv source in both Plex and XBMC.  They will both need some time to scan and also identify the files in their own way.

The recording now looks like this:

Hell on Wheels S02E02 (Durant, Nebraska).nuv -> /mnt/tv/5066_20120825091500.nuv

How do update your mythtv recording schedules to use the mythicalLibrarian scripts

You'll need to use mysql to update the database.  You setup may be different.

mysql -umythtv -pmythtv mythconverg
update record set autouserjob1=1 where autouserjob1=0;

That should update your recording schedule to use mythicalLibrarian to run after the recording has ended.

This will work where mythicalLibrarian is setup as userjob 1.   Modify the job number to meet your setup.

Saturday, August 11, 2012

How I Manage My Music Collection

I've been using iTunes to manage my music since 2005 after an unfortunate iTunes folder organization mishap.  Prior to then I'd been using a combination of Windows Media Player and Musicmatch Jukebox for management for music I had on Samba Shares.  I used the convention Artist - Album (Year) and iTunes used Artist/Album  so my I had a ton of orphaned folders and I still do :-)

I gave up and eventually allowed iTunes to just handle the folder structure since I had a dedicated Mac Mini at that point. I would rip CDs and let iTunes convert them to 192kbps mp3s and then manually copy to the Samba share.  I had a local copy and a copy on my NAS.  This was tedious but I never wanted my entire library to become mangled again.

I moved up to dedicated NAS instead of Samba Shares on a windows media center.  The problem with NASes is that if a proprietary has has a logic board failure or raid controller failure you must purchase from the same manufacturer if you want your data.  I had a logic board failure and was down for 6 weeks during the holiday season from November  2009 - January 2010. Upon placing the drives back in the NAS in the correct order a reboot of the NAS reinitialized the raid array and wiped all of my music, movies, documents, backups and website starting from 1992. :-((((((

I cried and have spent the better part of  2 years recovering the data from old hard drives and online backup.

I now only buy mp3 from iTunes, Amazon, Google play or directly from the artist or distributor.   Most of these non iTunes MP3 markets have an iTunes and Windows Mediaplayer app that adds the music that you've purchased and downloaded into your itunes music collection.  All my iTunes purchases are automatically downloaded to the library and copied over to the NAS.  Google Play and Amazon purchases require and extra step to make this happen.  It's usually just a few clicks to identify the music on their websites and initiate a download to their own app that adds the content to my iTunes library.  Google Music Manager and Amazon Music Importer also copies that music to the cloud so I can listen pretty much from any mobile device or computer.

All my music is in the cloud, locally on a Mac and on a Nas so I never have to worry about losing it anymore.

Here's the simple bash script that runs at the top of the hour to copy my music over to a mount on my NAS

Crontab Entry
5 * * * * /Users/xxx/



cd /Users/xxx/Music/iTunes/iTunes\ Media/Music/

rsync -av . /Volumes/Music/


Sunday, August 05, 2012

Wii U Experience - Atlanta Ga

I was invited to the Nintendo Experience for hands on game play to the successor of the Nintendo Wii. I brought my 10 year old cousin as a guest because he will have a great what did you do over the summer story to tell.

I was pretty impressed by the playback and in improved control.  Games are finally in HD. 

I played New Super Mario Bros U, Luigi's Mansion, Rayman Legends and Just Dance 4.

I smoked a family of 3 playing Just Dance 4 dancing to Rock Lobster. With the Wii Motion plus controller tracking your hands and body's position and movement in space and in relation to 3 other players is a modern programming miracle.  Ubisoft has a hit on their hand. Its no Xbox Kinect but has

There was a little bit of stutter in New Super Mario Bros U with 4 players connected.  I'm hoping this was just a bug in the demo unit. Hopefully Nintendo can work out the I/O or processing hiccup. Overall I'm really excited because up until now I thought the Wii U would be underwhelming after I saw the E3 Keynote. I sent Nintendo a social message blast to go back to the drawing board.

Nintendo if you're listening, please include the following for a hit:

Ethernet! Cmon
DLNA playback
Bluray Support
Skype and/or Google Talk chat with the GamePad or release a Bluetooth or USB HD Webcam
Use USB 3.0 for future proofing