Friday, 10 February 2012

New Project: itunes-remote-control-server

The other day I create a new opensource project on Google code called itunes-remote-control-server. The idea behind the project is to create a TCP server that can be used to control iTunes. This will allow easy headless control of a iTunes machine.

I'm aim to use the server with my other project Media Manager. The idea being that once media manager has made changes to media files it can tell iTunes about the changes. This will keep iTunes in sync with the media directories been managed by media manager. Their are two parts to this, a new store within Media Manager which will hopefully be in the next release and a TCP server on the iTunes machine.

So I've created a basic server that works on Mac OSX. It's written in ruby and uses mac ruby script bridge to talk to iTunes. I'm hoping to add windows iTunes support before a official release, but this is still at investigation stage at the moment.

Currently the server will allow you to add or remote tracks from the iTunes library as well as listing/removing tracks whose files can't be found any more (Dead tracks). Their is simple authentication support and it's configuration is done via a XML file.

Their are also some command line utilities that can be used instead of the server if people want to drive iTunes from the CLI without the server. So far these are for finding tracks not in the iTunes library and dead tracks.

So currently I've not released it, though I hope this will not take to long. Just need to look into the windows side of things. If people want to try it out, then they will need to do the following:

git clone https://jp.stanford@code.google.com/p/itunes-remote-control-server
cd itunes-remote-control-server
gem build ./itunes-controller.gemspec
gem install itunes-controller-0.1.0.gem



This will install the build gem and provide the command line tools:

itunesController.rb   <- The TCP Server
llistDeadTracks.rb
listNewTracks.rb
removeDeadTracks.rb

Anyway I'll post a update again when It's time for a official release. At that point the ruby gem will be downloadable from the website.

Monday, 4 July 2011

Media Manager v2.0 Released!


Media Manager v2.0 has just been released. The project has had a name changed since the last updated (previously known as MediaInfoFetcher). This is a major update that focus on managing media (Currently TV Shows and Films) and much greater reliability when fetching meta data.

Some of the change high lights are as follows:
  • Better searching for film and TV information using XBMC scrapers
  • Tool to download and stay uptodate with the latest XBMC scrapers
  • Much improved film title and show name lookup by variours searching strategies
  • New actions, such as ability to execute system commands on media files and rename the media files
  • Enhanced renaming patterns which new token types and optional parts to patterns.
  • Can lookup film information from .NFO files.
  • Improved configuration options
  • New XML store for caching media information
  • Improved tag chimp source, that will use the sites API instead of scraping the HTML.
  • Maybe new configuration options (and a new configuration format).
  • New installer for all platforms.
This has been quite a while coming, but it's finally here. Please use the project website to let me know of bugs or feature requests. Also if you find the application useful then let me know on my blog.

So click here for more information.

Thursday, 2 June 2011

MP4 Libraries in Media Manager

MediaManager 2.0 is pretty much ready to release apart from a problem with the MP4ItunesStore. This store is used to save metadata into mp4/m4v files so that they appear correctly in iTunes and can be used with AppleTV, iPad's etc....

In version 1.x this store was based around a command line application AtomicParsely. However this always anoyed me as it was not very easy to use and was slot to drive it from java.

In version 2.x I've been working towards a pure java solution. I first of starting to use jaudiotagger. I found this while working on my podcaster application. This is more about audio files than video though. It works well for podcaster, but not very well for MediaManager. I had to hack it quite a bit before it would work, then I started to find problems with parsing some MP4 files.

I stumbled across mp4parser next. This is pretty good and does everything I need or so it seemed at first. I found a number of bugs in the library. I fixed a number of these and sent patches to the project (Still not been applied :-( ), I then found a case where a DVD I had turned into a MP4 file would get corrupted.  raised a issue on this also. Not only did it courrpt the file, but it gave me no way of detecting a error. Due to these problems I had to stop using the library. The project has a hight amount of activity so I'm still hoping these things might get fixed.

I've looked around for other Java solutions, but not found any. I could possibly write my own or fork one of the others, but that's too much work for now. Instead I've started to look at using a native library called MP4v2 which is used by a number of other C/C++ projects. To create the bindings I'm using JNA. This as not been without problems though. Currently on Linux I'm seeing segfaults unless I use a 32Bit sun JVM. Strangely this happens on a 64Bit sun JVM also. I'm currently hopeing to find out why and fix the problem, but will see what happens.......... It might mean we only have iTunes support for curetain Arch/JVM's.

Anyways once these problems are solved, MediaManager will be ready for release

Thursday, 12 May 2011

MediaInfoFetcher is no more, long live MediaManager

No need to panic, MediaInfoFetcher has been renamed to MediaManager to reflect that the next version will be much more that a tool to fetch media information. It is not a tool for managing Media collections.

Since my last post, Media Manager as really started to take shape. Many bugs have been found and fixed with is bringing it nearer to a release. Also it now has nearly all the features that will be present in the next release. These include the following:
  • Better searching for film and tv information using XBMC scrapers
  • Tool to download and stay uptodate with the latest XBMC scrapers
  • Much improved film title and show name lookup by variours searching strategies
  • New actions, such as ability to execute system commands on media files and rename the media files
  • The renaming as also improved quite a bit as the patterns have new elements like optional parts.
  • Can lookup film information from .NFO files.
  • Improved configuration options
  • New XML store for caching media information
  • Improved tag chimp source, that will use the sites API instead of scraping the HTML.
  • New installer for all platforms.
As you can see that is quite a impressive list of features going into the next release and their are still a couple in the works. The previous version had the concept of sources and stores, but now has the concept of actions. Actions are performed on the media files when they are found. So a new action as been created for renaming media witch used to be the only thing the old version could do.

Users are able to write the own custom actions, stores and stores in Java and use them. This gives a great way for custom things, but also allows for testing of new actions, stores and sources before they make it to a release.

Anyhow the next release is getting closer......

Tuesday, 1 March 2011

MediaInfoFetcher version 2.0 progress so far....

It's been a little while since I posted any kind of update on the my open source project MediaInfoFetcher. For those not familiar with the project. MediaInfoFetcher is a application and a API which can be used to retrieve TV show and movie meta data from Internet sources. This information is then stored locally and can be used to rename media files with the correct title.

Version 1.0 was released sometime ago now, with several updates since then. However it was always had problems keeping up with the web sites that it scraped for information. So I've been working on version 2.0 for a little while now and it's making good progress. A lot of things will change in the next version which will help to keep it up today and always working in between releases.
Some of the features to look forward to:
  • Added a source that uses XBMC media player scrapers.
  • Checks for and downloads updates of XBMC scrappers.
  • Removed the old XMLStore and replaced it with a new one that stores all media files in a single XML file.
  • Removed some of the source which were always broken. Now using the XBMC source instead.
  • Much better searching of media data (films and tv).
  • No longer uses Atomic Parsely to write .mp4 metadata. Uses a pure Java solotuion instead.
  • And much more to come....
Things are shaping up nicely, but it still has a way to go before it's release ready. I'm very pleased with it's ability to use XBMC scrapers. This means it can always obtain media information without having to worry about it going out of date. It also means their are many more sites that media data can be obtained from as their are quite a lot of different XBMC scrapers.

Monday, 1 November 2010

NFS on MacOS is broken!

I've been looking into iPhone development lately as I wanted to get an idea about what is involved. This means I've been force to use my Mac Mini for development. I'm not really a Mac user as I mostly use Linux (KDE). At first I wanted to use eclipse like I do for everything else. Currently this does not seem possible so I've been forced to use xcode.

I'll probably talk more about xcode in a later blog entry, but for now I'd like to rant about how bad NFS support in Mac applications are. I have NFS shared directories so that my server contains all user details. This has lots of benefits like been able to move between my different machines, but the main advantage is that they data is backup centrally from the server.

It seems many mac applications just don't work with NFS. I've never had a problem in Linux, all applications work with NFS that I've tried. I even play WOW from a NFS directory via crossover games with no problems!

So here is a list of apps I've discovered have problems:
  • iPhone simulator (Can't install developed apps)
  • xcode (Can't save files)
  • Installers (One of my macs can't install stuff unless they are done from local dir).
If anyone knows how to get round these problems I'd love to here it.

Tuesday, 5 October 2010

Bacula - The Open Source Network Backup Solution

Been a little while since I've blogged. I mainly blame this on World of Warcraft which I'm still playing quite a bit on Linux.

I've been looking at how I do backups at home again. I've written a script (in perl) that performs my backups, but it's been having a few problems. First of I worte it to backup my how server to my Netgear NAS. It did this using rsync to a NFS exported filesystem on the NAS. It turned out that the NAS crashes when about half way though a full backup! For some reason the NFS is pretty flakly on my Netgear ReadyNAS (which is a sparc CPU btw!).

The NAS also supported ssh and rsync protocols, so I stopped using NFS and started to transfer things over SSH. This however showed up another problem. It seems that the rsync parameter --list-dest does not work over SSH. This parameter is used to perform the incremental backups and only copy the stuff that has changed since the last time. To perform a full backup takes about 3 days currently (100Mbit network), so this is a no go. The backups need to be incremental.

I've started to think about writing my own backup application, but this time making a client/server type app that does not use rsync. Instead would have it's own storage daemon running on the NAS. At this point I started to look around at other free applications and discovered Bacula. This is what I've using to perform backups now.

This is a very nice application that consists of 3 main parts. Their is a storage daemon, that sits on my NAS. A Director which is a server that controls everything and a file daemon that also sits on my server. The file daemon is the client that is responsible for pulling files when the Director requests them. The director then stores them in the storage daemon. The good thing about this is I can run a file daemon on all the machines on my network and just have a single director on the server.

It was easy to install on my OpenSuSE machines, version 5 was available as packages and I used zypper to install them. Getting the storage deamon onto the NAS was harder. Their are packages, but they are a older version that is not fully compatible. I found I could perform backups, but not restore files. So I grabbed the latest sources and cross compiled it for the NAS which runs a SPARC architecture :-) If your familiar with cross compiling, then this is not to tricky. I need to some extra libs (sqlite3, zlib...) and then build the storage daemon static. After this it worked like a charm.

Bacula is a very command line based application, it's controlled from configuration files and a console. Once I got these all working I manged to setup nightly incremental backups. The acuall backups appear to be a lot faster than my previous solution. Their are some GUI consoles, but this are basicly not much more that a place to type commands. So in my view still a command line. I bealive their is also a web client, but I've not got round to installing that. Will be giving it ago soon.

If I don't find a good graphical client, then I might think about creating one. Main reason for this is we have a number of laptops in my family (windows and Linux) and I'd like these to have a good UI for doing backups.