MKV or other video formats

Having trouble playing all your different media types? Ask here!
Junon

Posts: 8
Joined: Wed Oct 31, 2012 4:40 pm
Location:

HTPC Specs: Show details

#41

Post by Junon » Thu Nov 01, 2012 1:58 am

crawfish wrote:
Junon wrote:I was actually looking into that, but in the process, I discovered that basically there are no good netflix plugins for any other platform EXCEPT WMC. I think boxee had a good setup when it was an installable platform, but that went away. If I could make my xbox boot directly into netflix, then I'd probably be content to split up the roles like that, but since I can't, I keep trying to make this work.
I don't understand. If you find Netflix in WMC acceptable, why can't you continue to use WMC for Netflix? Like I said, I use WMC solely for DVR and XBMC for all other library-based video, and I have seamless control of both with my remote control. I have buttons defined to start one while closing the other. Works great.
Oh, I see what you're saying. That doesn't sound like a bad solution... I'm just frustrated that I got it to work before, and it was a nice and straightforward setup once it was going. I'm not a huge fan of any media indexing or transcoding based solutions (tried Plex) just because I keep all my media on another server and I leave it with the downloaded file names, although I usually change the directory names for the movies. Because of this, I never really trust any kind of indexing to be smart enough to account for all the situations its going to run into, and since it's like 5TB of data, I don't want any kind of automated copier/renamer, because I don't have that kind of storage and can't rename the files because they're still in use after the download.

Also, could you go into a little more detail on your key combinations to start one while closing the other? I don't want to have to start from scratch if I go that route and you've got already got it figured out very nicely. Thanks for your comments btw.

crawfish

Posts: 465
Joined: Fri Jan 13, 2012 5:16 am
Location:

HTPC Specs: Show details

#42

Post by crawfish » Thu Nov 01, 2012 2:53 am

Junon wrote:Oh, I see what you're saying. That doesn't sound like a bad solution... I'm just frustrated that I got it to work before, and it was a nice and straightforward setup once it was going. I'm not a huge fan of any media indexing or transcoding based solutions (tried Plex) just because I keep all my media on another server and I leave it with the downloaded file names, although I usually change the directory names for the movies. Because of this, I never really trust any kind of indexing to be smart enough to account for all the situations its going to run into, and since it's like 5TB of data, I don't want any kind of automated copier/renamer, because I don't have that kind of storage and can't rename the files because they're still in use after the download.
XBMC doesn't transcode, and it doesn't alter your files. It's much better behaved than Microsoft's stuff, which for example, in WMC, changes timestamps and presumably updates something in recorded TV files when I play them, and then there was the Zune software, which loved to update hidden metadata for its own purposes. That sort of thing ticks me off to no end, because (a) it increases backup times by forcing the backup of the same files over and over again, and (b) it makes it impossible to detect file corruption by performing compares against a backup. I no longer use Zune, but every time I play one of my saved 29/59 clips, I'm reminded of how inconsiderate Microsoft can be when I back up. XBMC does none of that nonsense. As for the accuracy and quality of the indexing, XBMC uses TheTVDB.com and IMDB.com among others, and it is all extremely impressive. When necessary, you can provide overrides in the form of XML files, which can refer to (say) IMDB URLs for the bulk of the information, leaving you to supply just the information you want to add or override. That said, XBMC has a learning curve, some of which I wrote about here.
Also, could you go into a little more detail on your key combinations to start one while closing the other? I don't want to have to start from scratch if I go that route and you've got already got it figured out very nicely. Thanks for your comments btw.
See this thread, which talks about retasking WMC remote buttons for your own purposes:

http://www.thegreenbutton.tv/forums/vie ... =5&p=27820

and this post, which talks about using Autohotkey to launch multimedia programs:

http://www.thegreenbutton.tv/forums/vie ... 711#p11711

That should be enough to get you going. I've updated the program launching code since then, making it considerably more flexible and further refining the techniques. For one thing, I no longer need to shut down iTunes to prevent it from eating WM_APPCOMMANDs (Pause, Stop, and some others) generated by by the remote and intended for other programs, which is nice, because I like to keep iTunes open all the time. I keep meaning to finish the article I alluded to at the end of the thread with my "More to come..." comment, and since it got so long and has developed into sort of a series, for the introduction, I compiled a list of stuff I'm able to do to try to ward off the inevitable "tl;dr" comments if I were to publish it. It includes:
  • Most importantly, I get all the standard and custom remote control functions I want bound to the buttons I want on the remote I want, a learning remote that cost just $25 new, supports eight devices, has great button layout and ergonomics, lacks a screen so can be operated totally by feel, supports macros on the device buttons activated by long-pressing for Harmony-like "activities", and is powered by two ordinary AAs that last forever.
  • I'm able to launch WMC and XBMC while automatically closing the other as well as closing iTunes and other programs that can interfere with the remote and cause other problems.
  • For WMC, in addition to all its standard features, I have remote buttons for subtitles, zoom, 10 minute skip forward and back, 30 second skip back, and small (2.5 minutes) and large (4 minutes) "commercial" skip forwards.
  • For XBMC, I have remote buttons for all its standard features and several of its useful unique features, like Toggle Watched, Audio Delay, etc.
  • I have remote buttons to toggle fullscreen/windowed mode and move the active window between monitors for those times WMC or XBMC opens in the wrong state on my multiple monitor system or when I just want to use them in a different way for a while, like when I place a small WMC window on my primary monitor to watch live TV while tiling other windows like Firefox beside it.
  • I control both WMC and XBMC using a single device on my eight device remote, and I can easily extend my method to control other multimedia programs.
  • Just as I have many useful non-standard functions for WMC and XBMC bound to remote buttons, I do the same thing for my TV, AVR, BD player, and other components, including things like setting the TV to a specific input, directly accessing THX and Dolby PLii modes on my receiver, etc, none of which are present on the remotes that came with the components.
  • Over the last few years, whenever I've come across a function I want, it takes me just a few minutes to add it, and I don't play email tag for weeks with an unresponsive company like Logitech that ultimately doesn't help me.
Hopefully I will get some time soon to come back to this...

crawfish

Posts: 465
Joined: Fri Jan 13, 2012 5:16 am
Location:

HTPC Specs: Show details

#43

Post by crawfish » Thu Nov 01, 2012 3:37 am

On second thought, that's not quite enough to get you going. The program launcher keys need to be global, which means they must be chosen such that nothing else uses them. This means you can't just use Autohotkey to retask the three "useless" MCE remote buttons, Star, Sharp, and Clear, which send Shift+8, Shift+3, and Esc, respectively, because those key combinations have meaning elsewhere. Instead, you'd have to modify ReportMappingTable to cause those remote buttons to send different key combinations, and I'd recommend the function keys F13-F24, as they don't appear on normal keyboards and aren't used by anything. With that in mind, my current Autohotkey script looks like:

Code: Select all

; Start WMC
^F13:: ; [Windows AKA Green Button]
	RunMultimediaProgram(g_WCNameWMC)
	return

; Start XBMC
^F14:: ; [#]
	RunMultimediaProgram(g_WCNameXBMC)
	return
The relevant part of my ReportMappingTable is:

Code: Select all

0d,00,00,00,04,01,68,\ ; [Windows]		Ctrl+F13
1c,00,00,00,04,01,69,\ ; [#]			Ctrl+F14
The rest of the Autohotkey code that makes it work is:

Code: Select all

g_ByClass = ByClass
g_ByTitle = ByTitle

; NB: #IfWin doesn't support variables so must use the actual class names with it.
g_WCNameWMC = eHome Render Window
g_WCNameXBMC = XBMC
g_WCNameiTunes = iTunes

g_pathXBMC = C:\Program Files (x86)\XBMC\XBMC.exe
g_pathiTunes = C:\Program Files (x86)\iTunes\iTunes.exe

;g_WCNames := [g_WCNameWMC, g_WCNameXBMC, g_WCNameiTunes]
; WMC isn't included in the map because it's started with a hotkey. It's treated
; specially by RunMultimediaProgram.
;g_WCNameToPathMap := { (g_WCNameiTunes): g_pathiTunes, (g_WCNameXBMC): g_pathXBMC }

; Experimental exclusion of iTunes dependent on remapping MM keys working (iTunes otherwise
; claims some MM keys when its open, even if it doesn't have the focus)
g_WCNames := [g_WCNameWMC, g_WCNameXBMC]
; WMC isn't included in the map because it's started with a hotkey. It's treated
; specially by RunMultimediaProgram.
g_WCNameToPathMap := { (g_WCNameXBMC): g_pathXBMC }

RunMultimediaProgram(wcName)
{
	global g_WCNameWMC
	global g_WCNames
	global g_WCNameToPathMap

    for index, item in g_WCNames
	{
		if (item != wcName)
			WinClose ahk_class %item%
	}
	if (wcName = g_WCNameWMC)
		Send #!{Enter}
	else
		RunOrActivate(wcName, g_WCNameToPathMap[wcName])
}

RunOrActivate(idWnd, path, findMethod = "ByClass")
{
	global g_ByClass
	if (findMethod = g_ByClass)
		prefix := "ahk_class "
	else
		prefix := ""
	id := prefix . idWnd
	IfWinNotExist %id%
		Run %path%
	else
	{
		WinActivate
		WinShow
	}
}
That comment about "excluding iTunes" refers to me recently using ReportMappingTable to map all the multimedia buttons that normally send WM_APPCOMMAND to keystroke combinations, translating them inside my AHK script to the relevant WMC and XBMC commands. This way, I can keep iTunes open all the time without it sucking up those button presses. Here's a small excerpt of that for WMC and XBMC:

Code: Select all

#IfWinActive ahk_class eHome Render Window

F18:: ; [Stop]
	Send ^+s
	return
F19:: ; [Skip Forward]
	Send ^f
	return

#IfWinActive ahk_class XBMC

F18:: ; [Stop]
	Send x
	return
F19:: ; [Skip Forward]
	Send . ; StepForward
	return
Anyway, I hope this made some sense and is useful. (The article I'm working on ties this all together, I promise. :lol:)

Junon

Posts: 8
Joined: Wed Oct 31, 2012 4:40 pm
Location:

HTPC Specs: Show details

#44

Post by Junon » Thu Nov 01, 2012 4:21 am

Oh, this is excellent, thanks a ton for taking the time! I've been using a Logitech Harmony 550 http://www.homesfun.com/wp-content/uplo ... 1HXYJL.jpg and several cobbled together remote programs to feed the commands I need to the HTPC. I've generally gotten it all to do what I want, although the remote, even with the screen, sometimes requires an inelegant button assignment. I've always wondered what the actual secret hidden MCE key commands were ACTUALLY sending though, so that's very helpful. I'm pretty sure I've never used autohotkey yet, and it looks fairly script heavy. Is it easy to do basic tasks and then ramp up from there or am I going to have to try to find someone's config file and cobble it together into something for myself? I look forward to seeing your finished article!

crawfish

Posts: 465
Joined: Fri Jan 13, 2012 5:16 am
Location:

HTPC Specs: Show details

#45

Post by crawfish » Thu Nov 01, 2012 7:44 pm

Junon wrote:I'm pretty sure I've never used autohotkey yet, and it looks fairly script heavy. Is it easy to do basic tasks and then ramp up from there or am I going to have to try to find someone's config file and cobble it together into something for myself?
The RunMultimediaProgram and RunOrActivate functions I posted in my last message are actually the most complicated part of my Autohotkey script. The rest of it is just a lot of hotkey definitions. To take full advantage, however, you have to understand ReportMappingTable, and then you have to be able to get the codes into your remote, which I think I touched on in the messages I linked to and go into much more detail in the article I'm working on.

An alternative to this is EventGhost, but to control other equipment like AVRs and TVs, if they can't be controlled via TCP/IP, you have to buy an HDMI-CEC USB bridge ($50 or so) or RS232/USB serial adapter cables, whatever your equipment requires. There's also a lot more "device upgrade" support for JP1 remotes than Event Ghost "plugins"; for example, I've been unable to find an EG plugin for my Pioneer AVR and was looking at adapting one for a Marantz receiver before I bailed on that idea. EG would only give me one new function I don't already have, the ability to set the AVR volume to a specific number, and it's just not worth the effort for me to switch. I also find the Autohotkey script a lot easier to work with.

ejvette

Posts: 22
Joined: Thu Oct 04, 2012 7:13 pm
Location:

HTPC Specs: Show details

#46

Post by ejvette » Tue Nov 06, 2012 11:03 am

Thanks guys. I was wondering how to get those MKV files to play and the simple install of the Haali Media Splitter did the trick!

crawfish

Posts: 465
Joined: Fri Jan 13, 2012 5:16 am
Location:

HTPC Specs: Show details

#47

Post by crawfish » Tue Jan 06, 2015 10:29 pm

Updated not to special-case launching WMC with Win+Alt+Enter due to a problem introduced by iTunes 11. I'm unable to edit the original post, I guess because it's so old, and while the changes are minimal, it was easier just to repost the whole updated code section.
crawfish wrote:The rest of the Autohotkey code that makes it work is:

Code: Select all

g_ByClass = ByClass
g_ByTitle = ByTitle

; NB: #IfWin doesn't support variables so must use the actual class names with it.
g_WCNameWMC = eHome Render Window
g_WCNameXBMC = XBMC
g_WCNameiTunes = iTunes

;;;; Begin 1/6/2015 changes.

g_pathWMC = %A_WinDir%\ehome\ehshell.exe
g_pathXBMC = C:\Program Files (x86)\XBMC\XBMC.exe
g_pathiTunes = C:\Program Files (x86)\iTunes\iTunes.exe

;g_WCNames := [g_WCNameWMC, g_WCNameXBMC, g_WCNameiTunes]
;g_WCNameToPathMap := { (g_WCNameWMC): g_pathWMC, (g_WCNameXBMC): g_pathXBMC, (g_WCNameiTunes): g_pathiTunes }

; Experimental exclusion of iTunes dependent on remapping MM keys working (iTunes otherwise
; claims some MM keys when its open, even if it doesn't have the focus). The goal is to allow iTunes to
; remain open while running WMC and XBMC.
;
; Seems to work fine! However, cannot send standard command Win+Alt+Enter to launch Media Center,
; because if iTunes is open and has the focus, it will start playing some random song. Noticed with
; iTunes 11; don't know about earlier versions.
g_WCNames := [g_WCNameWMC, g_WCNameXBMC]
g_WCNameToPathMap := { (g_WCNameWMC): g_pathWMC, (g_WCNameXBMC): g_pathXBMC }

RunMultimediaProgram(wcName)
{
	global g_WCNameWMC
	global g_WCNames
	global g_WCNameToPathMap

	for index, item in g_WCNames
	{
		if (item != wcName)
			WinClose ahk_class %item%
	}
	RunOrActivate(wcName, g_WCNameToPathMap[wcName])
}

;;;; End 1/6/2015 changes.

RunOrActivate(idWnd, path, findMethod = "ByClass")
{
	global g_ByClass
	if (findMethod = g_ByClass)
		prefix := "ahk_class "
	else
		prefix := ""
	id := prefix . idWnd
	IfWinNotExist %id%
		Run %path%
	else
	{
		WinActivate
		WinShow
	}
}

Post Reply