Tuesday, March 22, 2011

Configure XBMC 10 to use Media Player Classic

I use XBMC on a regular basis for my home-theatre PC and in general I love it. Some of it's only limitations revolve around hardware acceleration. First of all, on my current Windows XP setup there is none! I have a new Windows 7 based machine in the works, however, and even then I find it limited. Specifically, there is no deinterlacing of my Sony camcorder recordings which are 1080i AVCHD. So I set about configuring XBMC to selectively use Media Player Classic - Home Cinema edition (MPC-HC) for only those video files which required it.

MPC-HC is a DirectX-based video player which has both it's own built-in 'MPC' decoder as well as access to any installed DirectX codec, e.g. Windows 7's DTV decoder.

Along the way I found a lot of gotchas in XBMC's support for external players, so I decided to write it up as this new post.

  • You can't simply edit the original configuration file in-place
  • If not done correctly the configuration file will make MPC-HC the default player
  • I haven't been able to make this work on Windows XP without MPC-HC becoming the default player -- regardless of the rules I specify.
  • The 'rule name' check also applies to the folder name, i.e., a 1080p mkv located in a folder called 'converted from 1080i' will still playback with MPC-HC!
  • The formatting is completely unforgiving (and arbitrary)! For instance, you MUST MUST MUST include the extra / character at the end of each new rule you add.
GENERAL PROCEDURE To setup XBMC v10 on Windows 7, so that it uses MPC-HC to playback 1080i and .m2ts (AVCHD) files:
  1. Locate the 'playercorefactory.xml' in the folder,
  2. Copy it to your personal folder,
  3. Edit the new .xml to add the 2 sections below
*** Add this to the '<players>' section (edit the .exe path as necessary)
<player name="MPC-HC" type="ExternalPlayer" audio="true" video="true">
<filename>C:\Program Files\Media Player Classic - Home Cinema\mpc-hc.exe</filename>
<args>"{1}" /fullscreen /close</args>
*** Add this to the '<rules>' section
<!-- Play "1080i" and *.m2ts with MPC-HC --> <rules action="prepend">
<rule filetypes="m2ts" player="MPC-HC"/>
<rule name="1080i" player="MPC-HC"/>

FINAL NOTE - Make sure it's inserted before the final </rules> and </playercorefactory> commands!

UPDATE: I found that I had to specify <hidexbmc>True else it interfered with MPC-HC. I've updated the example to use this setting.