-
New BlogSvc Release and Oxite
Wow, I believe I’m all caught up on the recent hype around Oxite. Although I can’t help but feel a bit left out in the cold. I mean BlogSvc has been on codeplex much longer than oxite and it never received this much attention. It is a shame because I believe the newest release, BlogSvc 0.8 Wizard Release is solid example of how to build a content management solution using MVC.
I know BlogSvc doesn’t yet have all the fancy administration pages or widgets/plugins yet, but we have a solid foundation to get there. I wish we could bring all the developers together on one solution so we build the next WordPress on ASP.NET MVC. Perhaps combine the best of BlogSvc, BlogEngine.net, dasBlog, SubText all into one super solution and call it SuperPressTM.
</rant>
-
DirectShow Filters for Windows Vista x64 and 64bit Codecs
A new version of GraphStudio (an open-source graphedit replacement) was released that supports x64. This is big news because previously, there was not a single filter management program on the internet that would work with 64 bit codecs. Therefore, it was near impossible to understand why a media file would not playback in the 64 bit version of Vista Media Center.Background on 64bit and 32bit Codecs
When codecs are compiled for either 64bit or 32bit they are only compatible with media players of the same type. You cannot mix and match. This is especially a problem on Vista x64 because Vista Media Center runs as a native 64bit application. However, Windows Media Player on 64bit systems defaults to 32bit even though there is a 64bit version installed side by side (the start menu just points to 32bit version).
It’s Best to Choose a Side
Therefore, if you need Vista Media Center, stick to only 64bit codecs. Do not install any 32bit codecs and instead of using the default 32bit WMP, use the 64bit version found at “C:\Program Files\Windows Media Player\wmplayer.exe” or better yet use Media Player Classic – Home Cinema x64 edition. If you want to use a 32bit or x86 media player and still utilize VMC, then you’ll have to install two versions of each codec you want to use.
To make things worse, it is possible for 32 bit filters to conflict with 64 bit filters.
My (wild) guess would be that the graphbuilder is instructed by templates from 32-bit filters (either Haali or Gabest source/demux filters) to use some 32-bit source/demux instead of "File Source (Async.)" that for obvious reasons won't work – RadScorpian
His guess was confirmed.
Microsoft was stupid enough to make this keys shared between 32/64bit. This means that playback will break in many applications if you have got different source filters installed for 32/64 bit. Media Player Classic is the only DS player I know of that can cope with this issue. – clsid
This also explains why even with all the internal filters turned off, that MPC-HC x64 was still able to play video’s that other 64bit players could not. Since I installed some 32bit filters first, it created a registry key pointing to the 32bit filter rather than the 64bit filter. See Troubleshooting for more information on how I fixed it.
My Setup
I like to play MKV backups I keep on the hard drive so I use the following filter’s:
- MPC Video Decoder x64 (MPCVideoDec.ax) for DXVA hardware accelerated AVC and VC1 decoding
- Matroska Splitter x64 (MatroskaSplitter.ax) for playback of MKV and MKA files
- ffdshow x64 (ffdshow.ax) for playback of various video types and multichannel audio such as FLAC, DTS Master Audio, AC3 Dolby True-HD
Installation
ffdshow comes with an installer. When you install ffdshow make sure you uncheck the codecs that you want the MPC Video Decoder to decode with hardware acceleration (at least H.264 / AVC and VC-1).
Note: If you’ve already installed you can uncheck the codecs in the property page.
Important: you must run these commands as an adminTo install MPCVideoDec.ax and MatroskaSplitter.ax files you’ll need to do this manually. Put these files somewhere permanent and then register them using the following command lines:
> C:\Windows\SysWOW64\regsvr32.exe D:\Programs\Filters\MPCVideoDec.ax
> C:\Windows\SysWOW64\regsvr32.exe D:\Programs\Filters\MatroskaSplitter.axTesting Playback
To test you’ve installed the 64bit filters correctly, you can just try and play a file in the 64bit version of WMP. However, WMP gives you little if any indication of what went wrong if the video does not play back correctly (same with VMC).
A better method to check your codecs are installed correctly is with the afore mentioned GraphStudio x64.
Open GraphStudio and go File –> Render Media File… to open a graph of the media file. If you get a “Cannot render file” message then something went wrong and you should check Troubleshooting. If you see a graph built, then you should make sure it is using the proper filters. For example, for my MKV file I want it to use the MPC – Video Decoder for the x264 video and the ffdshow Audio Decoder for the DTS Master audio.
If the wrong filter shows up then you may need to alter the merit of the filters or toggle the type of filters that each codec will decode. To toggle merit, see Troubleshooting.
Troubleshooting
“Cannot render file” – This may occur if you don’t have the necessary codecs or there are conflicts with existing 32bit codecs. If you previously installed 32 bit codec you may need to delete a registry key to get the 64bit codec to work.
For example, I could not play an MKV file until I opened the registry “regedit.exe” and deleted the following key:
"HKEY_CLASSES_ROOT\Media Type\Extensions\.mkv"Wrong Filter in Graph – This may occur if there are multiple filters that are capable of decoding the media format. This is usually a problem if you prefer one filter over the other because one may support hardware acceleration and the other does not.
Some filter’s have many codecs built in and you must enable the codec from the property page. For example, the MPC – Video Decoder has a tab where you can toggle the codecs it handles. In GraphStudio, you can access a filter’s property page from the Graph menu –> Insert Filter… –> Choose Filter –> Click Property Page button.
In some cases this isn’t enough to get the filter to load. You may also need to alter the merits of the codecs involved. Merit values define the order in which the Filter Graph Manager tries to add filters during graph building. You can change merit values in GraphStudio.
GraphStudio is currently the only application that can manage 64bit codecs. All other codec managers only show 32bit codecs.
From GraphStudio open the filters and choose the filter you’d like to alter the merit of. For more information about setting a merit value, see Understanding DirectShow Merits.
-
Windows Live Family Safety Breaks Internet
The current version of Windows Live Family Safety may hose up your Vista machine. I recently installed this on a brand new Vista machine as I was installing Live Photo Gallery and it broke internet access and video streaming to the Xbox (via the Vista Media Center Extender)
If you try to uninstall Windows Live Family Safety, it will not fix anything. At one point, I saw the following error:
the Family Safety service has been disabled. Please ask the administrator for this computer to enable it. Until that's done, you will not be able to browse the Internet
I was logged in as an admin and I tried to disable the service, but since I uninstalled it, there was nothing to disable. Something was left behind by this program that was blocking port 80. I disabled the firewall and it still wouldn’t work.
Please note that I never signed the program into Live or enabled it before I uninstalled it. I don't know why it would start blocking the internet without asking me. My advice: Avoid installing Windows Live Family Safety
The only way I could fix this was re-installing Vista. I'm posting this in hope's that others will avoid this program.
Other links on the subject:
-
Chapter Grabber for Chapter Titles in MKV
I recently updated an old program I wrote back in the .NET 1.0 days. Seeing some of my old code was very interesting as suddenly I became very aware of how much I’ve learned since then.
The updates I made are mainly to take advantage of tagChimp which is an online database of media metadata. They have an XML API where you can get chapter titles for movies and TV shows.
I’ve been making some backups of my movies into my favorite container format Matroska or MKV. I like to be able to skip to my favorite part of the movie using chapters aka “Scene Selection” as commonly seen on DVD and Bluray discs. My favorite media player, Media Player Classic Home Cinema edition has support for these chapters built in.
ChapterGrabber allows me to open the chapter times extracted from either my DVD IFO file or an existing chapter file. I can then search for the chapter names and apply them to the chapter times. The result is scene titles for your backup as seen above.
There are more details on the ChapterGrabber page.
-
Change is Good for Technology
As many others, I’m very excited with the outcome of the presidential election. I’m proud to support who is being called America's first "tech president." His policies toward technology are very refreshing to a self proclaimed tech junkie like me. Hey, I bought a quad core as soon as they had 45 nano-meter transistors.
Obama’s policies can be viewed at the new website change.gov. Some of the highlights of his technology agenda are:
- Protect the Openness of the Internet
- Encourage Diversity in Media Ownership
- Safeguard our Right to Privacy
- Open Up Government to its Citizens
- Deploy Next-Generation Broadband
- Reform the Patent System
- Lower Health Care Costs by Investing in Electronic Information Technology Systems
These are great. I feel strongly about Obama working towards these goals. His view on net-neutrality is very refreshing:
The number-one priority of Obama's technology platform […] is to protect network neutrality to preserve the benefits of open communication on the Internet. The political argument surrounding Internet access is whether companies managing Internet traffic should be allowed to charge for higher speeds or capacities instead of treating all users equally. Service providers posit that charging for priority on the Internet will promote investment in networks and allow for better management of congestion caused by large amounts of digital data traveling online. Google, among other Internet firms, argues that service providers are pushing for profit that would stifle online innovation and economic growth.
"I will take a back seat to no one in my commitment to network neutrality," Obama said during a stop at Google's California headquarters. "Because once providers start to privilege some applications or websites over others, then the smaller voices get squeezed out and we all lose." -opensecrets.orgAlso, I hope to see a social revolution in the way people interact with the government. We should be able to directly vote on the issues rather than things being filtered through a “lobbied” congress. Or at least a nationally recognized system for tracking and providing feedback to our elected officials.
This is a great time for us in the technology community.
Disclaimer: The views represented here do not reflect the views of my employer.
-
LINQ Syntax Choice
Which LINQ syntax do you prefer? The fluent style or the query style?
I personally prefer the Fluent style as it appears to come natural to me. However, I have yet to deal with some of the more complicated joins that may work better with the query style syntax.
-
ASP.Net MVC Beta Crashing IIS7
With the new beta release of the MVC framework, I updated BlogSvc to compile and run with the new dlls that are now in the GAC. After deleting from the gac and finally copying the dlls to my bin folder I things running smoothly from within Visual Studio. However, when I deploy to IIS7, I am getting a crash.
I’ve tried cleaning out all the applications in my IIS and also restarted the AppDomains, sites, servers. I’ve also tried rebooting. Anyone have any idea’s? Does the beta run on your IIS7 in Vista?
I’ve asked this question on StackOverflow: Why is Asp.net MVC Beta crashing my IIS7?
Update: I toggled data execution preventions (DEP) and a couple a reboots later and the issue cleared up.
-
Deploy MVC Application
I previously thought Visual Studio.NET only supported automatically deploying “Web Site” projects but it also works with “Web Application” and “MVC” projects. Right-click on your project and choose publish.
After choosing publish it will upload all the files based on your “Copy” choice. You can watch the output window to track the progress:
------ Publish started: Project: WebMvc, Configuration: Debug Any CPU ------
Connecting to ftp://ftp.atomserver.net/wwwroot/...
Deleting existing files...
Publishing folder /...
Publishing folder App_Data...
Publishing folder App_Data/www...
Publishing folder App_Data/www/blog...
Publishing folder App_Data/www/blog/WelcomeToBlogService06...
Publishing folder App_Data/www/media...
Publishing folder App_Data/www/pages...
Publishing folder js...
Publishing folder themes...
Publishing folder themes/default...
Publishing folder themes/default/images...
Publishing folder bin...
========== Build: 5 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
-
Using the New DateTime Support in .NET 3.5 via MVC & jQuery
I’ve added New Global Date and Time Support to BlogSvc by utilizing the new expanded support for date times with proper time zone support. Some highlights in the MSDN documentation:
The DateTimeOffset structure represents a date and time value, together with an offset that indicates how much that value differs from UTC. Thus, the value always unambiguously identifies a single point in time. A DateTimeOffset value is not tied to a particular time zone, but can originate from any of a variety of time zones. The TimeZoneInfo class makes it possible to work with dates and times so that any date and time value unambiguously identifies a single point in time. Taking advantage of time zone support in the .NET Framework is possible only if the time zone to which a date and time value belongs is known when that date and time object is instantiated.
So the MSDN documentation is not clear on which class can make a date/time unambiguous. However, the last sentence is the best clue. We must capture both the UTC value and an originating time zone.
For an ASP.NET MVC application we can add configuration to associate all date/times to our preferred time zone.
With this configuration, we can now write an HtmlHelper extension to display a DateTimeOffset in our preferred time zone.
Call the extension method and pass it either a DateTimeOffset or a DateTime.
This will result in the follwing html:
<abbr title='Tuesday, October 07, 2008 10:01 PM (GMT-06:00) Central Time (US & Canada)'>10/7/2008 10:01 PM - CST</abbr>
This gives an abbreviated date/time display at your preferred time zone.
However, you may want to display time relative to the user browsing your website. There are two ways to accomplish this:
- Ask and store each user’s time zone
- Automatically determine user’s time zone using javascript
The first option is commonly used with forums and requires the user to register and choose their preferred time zone. The second option makes much more sense for content websites (such as a blog) since it can occur automatically without registration.
There is already a great plugin for jQuery that can display fuzzy times that are directly relative to the user. It is called the Time Ago Plugin. To use it, lets create another helper extension that utilizes a micro-format:
This creates abbreviations in the html, that when activated through jQuery show times that will be automatically updated even after the user has loaded the page.
This DateTime display is much more recognizable and personable to the casual user.
Head on over to the BlogSvc website to download the code.
Update: here is a bonus function that will allow you to format the date (with access to the time zone information) anyway you’d like.
Call it like:
-
MVC is Cool
I've recently spent many late nights learning (by implementation) ASP.NET MVC and I'm very pleased with the new framework. The old web forms model of programming was great for quick and dirty web apps but it really took too much control away from those developers who have a deep understanding of web technology. With MVC, it really lets web developers go back to their roots. For example, you are no longer dealing with “asp” controls but directly with the classic html input controls.
As part of my learning process, I converted BlogService over to Preview 5 release. The conversion went smoothly. For me, there was only a small learning curve as I’ve been tracking in MVC for a long time. It is a quite popular topic right now especially with the announcement of jQuery being included out of the box with .NET. How great!
Check out the latest release of BlogSvc to see the code: BlogService MVC Release 0.6