Wednesday, October 19, 2011

Playing back VC-1 (WVC-1) videos with DXVA in Windows Media Centre 7

After a lot of messing around with codecs, I've successfully gotten VC-1 videos to playback using DXVA hardware acceleration in Windows Media Centre on Windows 7. CPU usage is 8%-15% on a 2.13Ghz Core 2 Duo. This is down from around 80%-90%. GPU usage is around 10% on an NVidia GT440.

Don't bother with the Microsoft DMO codecs for VC-1 as they don't use DXVA (at least they don't with my NVidia GT440) and use more CPU time than software based ffdshow.

The ffdshow DXVA enabled codec for VC-1 seems to crash on the VC-1 streams I tried.

Solution:
Download Media Player Classic MPHC Stand Alone filters from here. Make sure you you download the 64bit version if you're using 64bit Windows Media Centre.
Extract MPCVideoDec.ax from the zip file to a safe location and then register it from the command prompt using "regsvr32 MPCVideoDec.ax".
Use Win7DSFilterTweaker and select "MPCVideoDec" under xx-bit decoders/VC-1.

Everything should work straight after that (no reboot required). If you encounter any problems then you can use the DSFilterTweaker to switch back to the Microsoft decoder and "regsvr32 /u MPCVideoDec.ax" to deregister the MPC codec.

Wednesday, December 1, 2010

mflow beta

We're beta testing our new web based product offering at beta.mflow.com.

Give it a go! :-)

Try listening to my music recommendations!

Friday, November 26, 2010

Gah, browser bugs

After an hour of debugging I tracked down a bug due to how Firefox handles Ajax calls.

All Ajax calls generally come with a X-Requested-With: XMLHttpRequest header to indicate that a call is an Ajax call.

If the response of the call is a 302 (redirect), then browsers will make an additional call to the new URL but in FireFox, this second call does not contain the X-Requested-With header.

Saturday, November 13, 2010

Web Designers vs Web Programmers


free website builder

Web Designers vs Web Developers is brought to you by Wix.com
Use creative design to make a Free Website
You are most welcome to share this infographic with your audience.

Saturday, May 29, 2010

Perfect crime

So, there's a tiny logic bug in someone's code that you need to fix but the code has changed quite significantly and you don't want to have to go back through subversion logs?

  1. Download the existing dll from the production server
  2. Disassmble the dll using ildasm (ildasm /out:code.msil code.dll)
  3. Use notepad to insert the fix you need in MSIL. Ildasm conveniently pads line numbers in the disassembled code so if you're lucky you can insert code without having to change any existing line number references.
  4. Reassemble the code and deploy (ilasm /DLL code.msil)
  5. Try not to act surprised that all those years of writing compiler and reflection.emit code came in handy yet again!
  6. Hope no-one notices.

// Original C#

ViewData["CODE"] = string.IsNullOrEmpty(id)
? GetCookieValue("CODE") : id.ToUpper();

// Original IL

IL_001b: ldarg.0
IL_001c: ldstr "InviteCode"
IL_0021: call instance string GetCookieValue(string)
IL_0022: dup
IL_0023: starg 1
IL_0026: callvirt instance void set_Item(string, object)

// Fixed C#

id = string.IsNullOrEmpty(id)
? GetCookieValue("CODE") : id.ToUpper();

ViewData["CODE"] = id;

// Fixed C# (more compact)

ViewData["CODE"] = string.IsNullOrEmpty(id)
? id = GetCookieValue("CODE") : id.ToUpper();

// Fixed IL

IL_001b: ldarg.0
IL_001c: ldstr "InviteCode"
IL_0021: call instance string GetCookieValue(string)
IL_0022: dup
IL_0023: starg 1
IL_0026: callvirt instance void set_Item(string, object)

Friday, April 16, 2010

mflow launches publically with new features and new website



Click on the image to get an account with £1 free credit.

If you already have an account, apply the promo code TN736X in your account settings.






Tuesday, April 13, 2010

About Thong Nguyen

Name
Thong Nguyen
Born
December 24th 1979
Cam Ranh, Khánh Hòa, Vietnam
Home Town
Christchurch, New Zealand
Current Location
London, United Kingdom
Current Job
CTO at mflow