Starting new series: Living in HD

Ok, I’ve decided to start new category: Living in HD. This is because I’ve recently bought a Canon HF100 camera as a replacement for my old Sony DV camcorder. I did it mainly because those “low” quality movies I’ve done with Sony look quite ugly on LCD TV capable showing 720p. And the tapes, those tapes. I hated copying them to computer at the filming speed.

So, here I am, a person that owns pretty decent consumer camcorder and doesn’t know almost anything about making the HD movies. And of course, I’ll be looking more like an IT guy on how did I understood some issues I’ve faced and finally what software or methods I’ve used to achieve some goals.

Ok, so here it comes – the first quest: Shooting in 30p

If you look here, you’ll find this nice description about shooting in 30p mode. Basically what I found important is the statement: “Excellent for action shots and sports”. I’ve seen many times before how movie maker and windows DVD maker break the video by not-deinterlacing the source video. After that the fast moving objects look almost exactly like it is shown in the simulated picture on Canon site.

So, I took a 30p film of a sports activity and tried to look at it using Windows Media Player. I had necessary CoreAVC and AC3Filter (those most probably came with Corel Video Studio trial), so Medial Player started showing the action I shot pretty straight forward.

Now, guess what. The image looked like interlaced. Hmmm … didn’t I set up the camera to take the shot at 30p?

Of course, I’ve tried to encode the m2ts files into WMV with Pinnacle Studio Plus 12 Trial and Corel’s (Ulead) Video Studio X2 Trial. Corel’s software failed to encode WMV. Pinnacle was ok – it did the job. Strangely, but those encoded movies were ok.

So I continued researching why the WMP shows something I didn’t expect to see – the interlaced view. It took quite a while to figure out. After searching couple of links I’ve found something like these statements:

Well, at that moment I could say only one thing. WTF is this 24/30p recorded in interlaced 60i? Anyway, getting a bit smarter at what to look for I found the place where I got the clear picture: here and here.

After getting things understood – fixing the stuff was fairly easy. I just set the CoreAVC to deinterlace using DirectShow. Everything became perfect.

I use WMV as a basic format at home, because I mostly play those videos by streaming them from Windows Home Server to Xbox 360, which is connected to my TV. Also, I like WMV for its good quality/size ratio (at least for my eyes).

So the next questions on the queue are: what would be the easiest and fastest way to work with AVCHD to produce WMV?

The general requirements and notes are:

  • Tool needs to join multiple files (longer movies are split by the camera into multiple files)
  • Tool needs to be as simple as possible
  • The tool needs to have WMV-HD (VC1) output support (primary output)
  • Command line option is welcome
  • Must have decent speed for my home laptop
  • Usage of all available CPU cores is a plus
  • Must run on Vista (and Windows 7 later)
  • Least amount of money investment required compared to useful available capability set
  • So far I’m not planning to use BlueRay output (I don’t have the device either)
  • I rarely use video editing (however I’ll do that from time-to-time)

Several initial thoughts are:

  • Windows Media Encoder
  • Expression Encoder
  • Windows Movie Maker (this and two above require purchasing CoreAVC, etc.)
  • Pinnacle Studio Plus 12
  • Make your own (based on WME most probably)

Those will come next.

Freezing query plan with SQL Server

Lets presume that you have a 3rd party application that just runs a query against the SQL Server. You see in the profiler that the query does not performs well and can see the way to optimize the query, however it is the 3rd party application.

Is it a dead-end or still there are chances to do something about it?

Very nice article here (in Russian language)

P.S. It is also quite funny to read as long as you know Russian language well 🙂

WCF certificate authentication under Windows Vista

Security is always A topic, because you have to maintain multiple gates. IIS and WCF is a good example of that. When you want to configure security settings for WCF – you’ll have to change the web.config file appropriately and … most probably the IIS configuration as well.

This post will serve me as a reminder as well on what I have to do in order to achieve the necessary results. So, let’s get to the topic.

The goal: To configure WCF service to allow only HTTPS and clients must be authenticated using client certificate using the basicHttpBinding (sounds simple, doesn’t it?).

The configuration:

Ok, the first things first – we need to configure basicHttpBinding to request SSL and request client certificates. For that we need to add binding section like this:

 <binding name="SSLBinding">
  <security mode="Transport">
   <transport clientCredentialType="Certificate" />

Generally it means that we will be securing communications at Transport level and the client credentials will be Certificates.

Second, we want to have access to metadata and map the certificates to Windows accounts. For that we will need to configure behaviors section:

<behavior name="SSLBehavior">
  <serviceMetadata httpsGetEnabled="true" />
  <serviceDebug httpHelpPageEnabled="false" includeExceptionDetailInFaults="true" />
      <authentication certificateValidationMode="PeerOrChainTrust" mapClientCertificateToWindowsAccount="true" />
    <windowsAuthentication includeWindowsGroups="true" allowAnonymousLogons="false" />

After this one is done – there is the last step to configure the service itself. Nice and easy:

<service behaviorConfiguration="SSLBehavior" name="Namespace.Implementation">
 <endpoint address=https://localhost/Implementation/Implementation.svc binding="basicHttpBinding"
  bindingConfiguration="SSLBinding" name="TheService" contract="Namespace.IContract">
   <dns value="Server" />
   <certificateReference x509FindType="FindBySubjectName" findValue="localhost" />

Setting up SSL with Windows Vista is too easy, just take a look: 

So far so good, but there is one more thing – to configure the SSL and map windows accounts to certificates. In Windows 2003 – there is a UI in the IIS management console, but You won’t find one in the Vista. Help comes from here:

It will configure your applicationHost.config file and add similar section:

  <access sslFlags="SslRequireCert,SslNegotiateCert" />
    <anonymousAuthentication enabled="true" />
    <windowsAuthentication enabled="true" useKernelMode="true" />
    <iisClientCertificateMappingAuthentication enabled="true" oneToOneCertificateMappingsEnabled="true">
        <add enabled="true" userName="computerusername" password="[enc:AesProvider:Encrypted password:enc]"
            certificate="Certificate content" />

Now lets get back to the bad parts:

First, you probably already noted that the service configuration is missing the IMetadataExchange endpoint, which is usually added to the service configuration. If you’d leave it, then you would receive errors like: "The SSL settings for the service ‘None’ does not match those of the IIS ‘Ssl, SslNegotiateCert, SslRequireCert, SslMapCer".

Also, you will need to enable anonymous authentication, because otherwise you will receive something like: "Security settings for this service require ‘Anonymous’ Authentication but it is not enabled for the IIS application that hosts this service."

And finally, couple of references I’ve used when going through all these issues (big thanks to authors):

BizTalk tools and updates

BizTalk best practices analyzer 1.1 was released with couple updates. The link: 

Keep up to date with BizTalk operations guide:

And finally, I found this one today and I am quite happy with the finding: It is a BizUnit designer or in other words GUI for setting up BizUnit test scenarios.

BizTalk User Group meeting #3

This week we had a local user group meeting, where I was giving a presentation about BizTalk development and deployment automation. The main idea for the presentation was that there are a lot of options to do the automation. As a sample cases I took these two scenarios:

  • Automating BizTalk solution build using MSBuild
  • Automating BizTalk deployment using PowerShell

I have uploaded my presentation and sample scripts to SkyDrive. In the zip file you will find presentation and sample scripts:

  • MSBuild script that builds sample solution, deploys it to BizTalk, starts app, etc.
  • Sample PowerShell script that gives some short overview what is PowerShell
  • Sample PowerShell script that uses BtsCatalogExplorer to list applications
  • Sample PowerShell script that allows to start/stop/restart host instances (thanks to Tomas Restrepo)

Download zip file from here.

What is interesting also that another speaker (Gediminas) was doing presentation regarding BizTalk operations automation using stuff from Microsoft.BizTalk.Operations namespace. He was doing a sample code using Visual Studio, but the same code looks very nice in PowerShell. After presentation he posted (check out here) code sample for resuming orchestration instances both in C# and PowerShell.

I can only guess what he is using now for the instance resume 🙂

BizTalk Operations Guide

Windows Home Server Rocks!!!

Yes, I have bought WHS and installed it myself on a PC I have used during the beta testing period. And finally, WHS did what is supposed to do. Helped me to recover the broken computer.

The story short:

  • One day WHS icon popped up with yellow message like "your wife’s computer wasn’t backed up for couple of days".
  • Single click deeper revealed message like "unable to read disk C".
  • chkdsk /r /f (check disk command line option, by the way, suggested by the WHS) reveals quite a bunch of bad blocks
  • Tried to backup once more, no luck … some more bad blocks come in 🙁
  • Next day I bought in the local shop new disk for her laptop (a bit bigger of course), replaced and booted from WHS computer recovery CD
  • Few answers to questions: the language settings, WHS password, the computer to restore
  • Selected last successful backup to restore
  • Waited for ~40minutes (could be a bit faster, but the another computer started backup in the evening or … night … well, you know)
  • Restart and …
  • Like it hasn’t been broken

Hopefully, I will not need to repeat the procedure with any of the home computers soon, but … IT WORKED, when the things went wrong 😀

And of course, there is always a little downside to the story: I had to reactivate Windows – you know, the hard disk has been changed. I had to use the phone version, because online activation didn’t worked. And funny thing, the automated IVR system said that it’s the key for Windows XP, while actually it was Windows Vista Home Premium 🙂

BizTalk 2006 R2 available

Yes, it is available on Technet (see here).

I have upgraded my existing BizTalk 2006 installation on Windows Vista (yes, I’ve been using unsupported configuration, but it ran pretty well for my needs).

My first interest after the installation was to check whether the WCF adapters were in place. And as You might guess – they were. Also, documentation were updated to reflect the change. Docs now include the walkthroughs for various WCF adapter usage. As we are talking about WCF, there is one thing to add: WCF LOB adapter SDK. I would suggest to look at that as well, especially take a very close look at this blog.

Ahh, and RFID is also one cool feature that is available for R2 users (Available in all versions). Dear wholesalers, retailers, etc. – please be sure you have investigated the functionality and opportunities.

If You are planning to install R2 into your machine and avoid unnecessary issues, I would suggest to allow setup to download the prerequisites, because the documentation points to the wrong URL.