Music Video playback for MCE

http://www.brains-N-brawn.com/mceMusicVids 2/27/2008 casey chesnut



this is just a quick little app i threw together to play music videos using Media Center. as an end-user, i'd actually stopped using Media Center in favor of UPnP A/V. my UPnP MediaServers are Windows Home Server and an Infrant ReadyNAS. for clients, i use an Xbox 360 as a UPnP MediaServer and a Klegg MediaShare which can access folder shares. the problem is the lack of extensibility for 3rd party developers. on the server-side, my last article was writing a custom UPnP server, so i could get more content to the Xbox 360. for the clients, there aren't any extensibility points. the Xbox 360 does have XNA, but it doesnt provide access to media, nor does it provide video playback. NOTE XNA v3 will end up providing the Zune with access to pictures and music, so hopefully the 360 console will get that media access as well ... along with access to videos and playback support.

specifically for this app, i needed a better way to play music videos. on the UPnP side, this involves manually selecting a video, playing it, when the video stops, repeat the manual process ... that won't work. another option was to extend my custom UPnP server to play a random file each time. so the user wouldnt have to select a video, but they'd still have to press a button to initiate play after every video. that's no good. another option would be to have the UPnP server stream a series of files as if it was one long video. this could work, but is more processor intensive than what i want to run on my WHS. if XNA has media access, and could play video, it'd be a simple app to have it render the video on a rectangular and respond to remote presses. then the user would just start the video music app like they were about to play a game. but its not currently possible. so that leaves MCE as my only option. NOTE since the 360 already has playlist support for music, it'd be simple enough for MS to add video playlist support to their UPnP client, and then this app wouldn't be necessary. since they sell music videos on the marketplace, i'm assuming this feature will be coming.


MCE does support video playlists, and they can play through extenders. so i spent a day writing this in XBAP first. but the XBAP was having a lifetime issue that i couldn't figure out how to get around. it would generate a video playlist and start playback. but after 5 minutes of user inactivity, the app would stop responding to user input (remoting problem). tried a couple different techniques to try and get around that, but they failed. now that i've already written the MCML version, i think i could have gotten the XBAP version to stay responsive by having a timer periodically trigger keyboard commands as if the user was providing input to the app, which might have kept it alive.

the UI is dead simple. it's just a <Video/> tag to display the music videos in. and there is a <ColorFill/> with margin values (specific to my TV) to hide the MCE border.

other than that, it responds to the Enter button to generate a new playlist (skip the current video) and the Back button to stop the current video and exit the app. 

when playing through an Xbox 360, the screen saver was kicking on after 10 minutes. to keep the screensaver from kicking in, there is a separate thread that fires every 5 minutes. this delegate fires a keyboard shortcut, simulating user input and keeping the screensaver from starting.

i'd actually make the app do more ... if the 360 had better codec support through MCE extender sessions.

360 Codecs

my music videos are mostly AVI (DivX and XviD) with a smaller portion being MPG.

AVI (DivX and XviD) plays fine on the 360 through UPnP. but AVI does not play through an MCE Extender session. don't ask why. because of this, i can't play a majority of the videos through MCE.

MPG does play through MCE Extender sessions, but it does not play through UPnP. again ... don't ask.

because of these limitations, this app can only play a portion of my music videos (MPG) ... unless i buy a V2 (PIKA) Extender

V2 Extender

so i bought one, a Linksys DMA2100. ends up it can play AVI files through an MCE extender session ... sort of. it'll play XviD files, but not DivX files. what the ...? but if you change the FourCC code on a DivX file to be XviD ... then it will play. are you lost yet? you should have heard me trying to explain it to the sales person when i returned it the next day. i'm not sure Microsofts support of codecs in the living room could get any more complicated?

i could easily write a program to change the FourCC of my music videos and get them to play, but there's another problem. with a wired gigabit connection, it was taking 5+ seconds for XviDs to start playing. real annoying. song 1 would end, the screen would go black for 5 (to 8) seconds, and then song 1 would start. the MPG video playlists did not have this slow startup behavior. and AVIs on the 360 through UPnP start immediately.

also, the animations were really slow on the extender. this makes me fairly positive that its doing pure hardware decoding, so its not likely to get any additional codec support in the future.


its just a simple app that i'm hoping becomes unnecessary in the near future.


C# MCML (VS 2008 project)


if the Xbox 360 did not get video playlist support through UPnP, but did get the ability to play AVIs through extender sessions, then i would update this.


couple different ideas. later