Showing posts with label itunes-remote-control-server. Show all posts
Showing posts with label itunes-remote-control-server. Show all posts

Thursday, 27 March 2014

Continuous integration

One of the tricky tasks with creating opensource software is building opensource software. I'm a big believer in continuous integration. This is the idea that everytime the code is changed, a build is performed by a build server and all the tests are run. Typically the server will notify people who checked in code and failed the build.

For a while now, I've been using Jenkins at home to build my projects. I've also been using it at work. This is a great which a massive feature list due to it's plugin architecture. It's been pretty useful at work where I have a lot more resources to host it on, but at home it was always a struggle to fund machines need for building things.

Since moving to using VM's on my server at home, I've been able to build my projects without to much problem and make sure they are fully tested. Successful builds get uploaded to a public section of drop box. This allows users to download nightly builds that have been fully tested.

Some of my projects such as the AtomicParsley fork or itunes remote server, need windows to build them. This is where I really start to run into problems. I'd have to pay for another windows license to run windows in a VM (A least thats my understanding). This would have to be done for each windows VM. Since they are not used for much else, this seems a waste of money.

It was for this reason that I was very happy to discover AppVeyor. This is a continuous integration service that can build windows software. It's a shame that it can't build linux software as well, but their are other service providers that can. I can also build Linux software on my home Jenkins system.

To test out AppVeyour I connected it to my bitbucket project for my AtomicParsley fork and set up the build. I ported the build of AtomicParsley over to cmake a while ago, which made building it really easy. My build script looks like this:

 mkdir build  
 cd build  
 cmake ..  

Imaging my surprise when it built. Next step was to configure the build artifacts. These are the things that are collected after the build has finished. So in this case, the AtomicParsley.exe executable. I shall have to look into publishing he builds as the next step.

I've also been looking into cloud solutions for building Linux software codeship looks promising and their support team have been very good. I'm testing this using my MediaManager project which is a much more complicated project. I'll blog more on this when I get things working.....

Friday, 11 May 2012

Initial release of itunes-remote-control-server

I've just published the inital release of my project itunes-remote-control-server. This is a project to make it possible to control iTunes on a headless server without a GUI. It provides a TCP server which can be connected to locally or remote by other applications to control iTunes. Alternatively it also provides command line commands for controlling iTunes.

Currently the server and scripts are able to perform these tasks:
  • Add new tracks/videos to iTunes Library.
  • Remove tracks/videos from iTunes Library.
  • Tell iTunes that the metadata needs to be refreshed from a file of the track/video.
  • List tracks that have missing files (dead tracks).
  • Remove tracks that have missing files (dead tracks).
  • Display information about tracks/videos in the iTunes library.
These operations can be performed by command line scripts, but also by using a TCP server. The next release of MediaManager will use the server to keep iTunes in sync with managed media libraries. In fact I've been running the latest svn version of MediaManager using the control server for a little while now. Seems to be working very well.

The server will work on windows or Mac OS X as long as the requirements are installed.
  • iTunes (latest)
  • Mac OSX or Windows
  • Mac Ruby ( On Mac OSX)
  • Ruby Gems: escape, sqlite3
See the install guides on the wiki for details on how to install it. If you find any issues, then let me know my the issue part of the website.

I'm hoping that work can start on the next version now. Currently have ideas for some features such as:
  • Different database backends
  • Play, pause, skip tracks etc...
  • Create a GUI to control iTunes remotely.

Wednesday, 7 March 2012

Adding more meta data capabilities to MediaManager

I'm please with the progress that have been make towards the next release of Media Manager. The biggest difference in this release will be much improved meta data stored within iTunes files and the ability to keep iTunes in sync. These achievements have cause be to create other projects. The first of these I already mention was a iTunes remote control server written in ruby. This is nearing it's first release, it just needs it's windows support finishing off.

I wanted this release of media manager to start a lot more meta data in m4v files so that they look a lot more like iTunes meta data. This means when you rip a DVD and want to iTunes to see it, it will look as if it can from the iTunes store. In turn this should mean it is viewable on iPads and apple TV's etc...

This release of Media Manager move to using the AtomicParsley command line tool to encode and view mp4 metadata. This tool has been around a while, but the orginal site has not been updated in a long time. Since then their have been new atom types that have been added to iTunes. So I came across  a fork of atomic parsley. This is pretty good and has had a number of features and bug fixes. This still does not do everything I would like, so in turn I've forked this project. I'm hoping that my fork's changes can be push upstream once they are ready. My fork can be found here

So I will be packing up my fork of AtomicParsley with Media Manager. The new features I've add so far are the ability to set the flavour atom (flvr) and a output option to list iTunes atoms in a XML format.

The flvr atom can be seen in files downloaded from the iTunes store. So that I've found that it contains these values:

  • 1:128
  • 2:256
  • 4:640x480LC-128
  • 6:640x480LC-256
  • 7:720p

It took me a while to work out what all of these mean, by I think I have it now. 7:720p is for videos that are 720p. These also don't have to be 16:9 aspect ratio.  1:128 is for audio files encoded in 128Kbs lossy. Simlary 2:256 is audio files encoded in 2:256 lossy. 4 and 6 were the tricky ones. It turns out that 640x480 is the 480p resolution, LC is the format profile of the audio. and 128/256 is the Kbs of the audio.

Usually 4 is used by low definition films and TV, 6 is used by music videos and 7 is used by High Def content. Their are probably other entries for this atom. If people know of any let me know. I can cater for them as well.

Media Manager is now making use of a tool call mediainfo to query the video and audio information of the file.   This enables media manager to know thinks like the flavour, aspect ration, type of audio etc...

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
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

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.