Ripping DVDs to My Home Media Player

by fwhagen Thu, 12 March 2009

After many years of trying, I have finally managed a good (enough) solution to playing video files on my TV.  And to make it more desirable, last year, we finally bought an HDTV.  I had bought an upconverting DVD player a few years ago for when we did finally do it, and it worked well enough, for awhile.  It was just too slow, and unreliable.  So when I finally upgraded the wife's computer, I used her old hardware along with some other pieces I had laying around to finally build a media PC.  I will never go back.  And the family is almost ready to go for a more expensive (really only a few hundred) solution.

Initially, I talked everyone into just running DVDs as normal, using the optical drive in the machine.  avi.netWindows does a much better job of scaling video than any consumer device I have used (or can afford).  Then I started ripping them to files.  I have been doing this for years, but not very successfully.  Decrypting the discs is easy.  Getting a good transcode has never been satisfactory.   Then I found avi.NET.  This great little tool does only one thing, but it does it very well.  It takes the decrypted DVD files and encodes them to an AVI file.  It has very few options, but does a really remarkable job. 

When encoding a video, I personally never use a fixed bitrate.  And the actual size of the end file is not strictly important to me, so I never choose the default option either.  I always choose the quality setting called Single Pass Quant.  The value used is dependant on the source video.  Animations tend to compress very well, so can use a higher value than FMV.  I tend to use higher numbers on the kids movies and lower on the movies I want very high quality viewing.  Like LAME, lower is better quality.  Below 2 makes for huge files, and above 6 starts to impact quality. 

The screen.SIZE attribute allows you to reduce the overall resolution of the output movie where 720 is typical max horizontal resolution for a widescreen DVD.  The aspect ratio is usually very accurate, but can be adjusted if needed using Height.  I have only had to do it 1 time, and then on a foreign title.  The Deinterlacing Filter works very well where needed and occasionally I will use the Smooth/Sharp if the source quality is poor.  Always use HQ mode; it makes the process slower, but it is very worth it.  I have not found much difference between DivX and XviD, except that DivX will thread across all 4 cores of my Q6600, so I use it, where XviD only seems to use 2.

It may take some experimentation as I am sure Your Mileage May Vary, but I am very pleased with results.  Sometimes I do have a problem reading some DVD rips, but running them through DVDShrink with no compression has always worked.  In fact, DVDShrink is a really convenient way to pick the tracks you want to convert and rip them to a convenient location. 

Keep in mind that avi.NET is only useful for converting DVD .vob files.  It will do nothing else.  For that I use MediaCoder; but that is another show.


Filed Under: Software

Does This String Have Anything In It? in C#

by fwhagen Wed, 04 March 2009

The following code should be failed by the C#.NET compiler:

if (eventName != null && eventName.Length > 0)

It should never be used.  People, always use this instead:

if (!String.IsNullOrEmpty(eventName))

It is much more compact, clearer, singleton, and as a String class method, more efficient.

So stop it!  You will thank me later.  Not to mention:  Where are your parentheses?  Block your code.  Other people have to read it too!

That is all.

Keywords: , ,

Filed Under: .NET | Programming | Rant

Coloring LogParser Pie Charts

by fwhagen Thu, 19 February 2009

Charting from LogParser is a very useful and powerful feature.  I enjoy collating our data into charts on hourly and daily summaries.  One of the charts I produce for my own use for the websites at work is Browser shares, like this one:

I especially like how all of the IE points are shades of blue.  Of course, you don't get that behavior out of the box.  But you can "style" the chart using a JScript config file.  The one I use is below:

// Title info
chart.Title.Font.Name = "Verdana";
chart.Title.Font.Size = 11;
chart.Title.Font.Bold = "True";

chart.SeriesCollection(0).DataLabelsCollection(0).Font.Size = 9;

for(nI=0; nI < chart.SeriesCollection(0).Points.Count; nI++)
    if (chart.SeriesCollection(0).Points(nI).GetValue(1) == "IE8")
        chart.SeriesCollection(0).Points(nI).Interior.Color = "#0099FF";
    if (chart.SeriesCollection(0).Points(nI).GetValue(1) == "IE7")
        chart.SeriesCollection(0).Points(nI).Interior.Color = "#008FE1";
    if (chart.SeriesCollection(0).Points(nI).GetValue(1) == "IE6")
        chart.SeriesCollection(0).Points(nI).Interior.Color = "#3876B7";
    if (chart.SeriesCollection(0).Points(nI).GetValue(1) == "Firefox")
        chart.SeriesCollection(0).Points(nI).Interior.Color = "#D87023";
    if (chart.SeriesCollection(0).Points(nI).GetValue(1) == "Safari")
        chart.SeriesCollection(0).Points(nI).Interior.Color = "#CFCCCC";
    if (chart.SeriesCollection(0).Points(nI).GetValue(1) == "Chrome")
        chart.SeriesCollection(0).Points(nI).Interior.Color = "#2DB632";
    if (chart.SeriesCollection(0).Points(nI).GetValue(1) == "Opera")
        chart.SeriesCollection(0).Points(nI).Interior.Color = "#BC1B12";
    if (chart.SeriesCollection(0).Points(nI).GetValue(1).substring(0,8) == "Netscape")
        chart.SeriesCollection(0).Points(nI).Interior.Color = "#246C6D";


Filed Under: LogParser

Converting FLAC to MP3

by fwhagen Thu, 12 February 2009

FLAC may be the perfect format for music storage with its far superior quality, hardly any players support it.  Especially my OEM in-dash player in the car.  So it is necessary to convert.  The batch file below will convert the FLAC to MP3 via WAV and tag from the original, assuming the correct pieces are installed as demonstrated.  I have it loaded into a batch file which I have placed in my Send-To folder for easy right-click/convert use.

"C:\Program Files\FLAC\flac.exe" -d %1 -o temp.wav
"c:\program files\lame\lame.exe" -V2 temp.wav %1.mp3
del temp.wav
"C:\Program Files\Lame\Tag\tag.exe" %1.mp3 --fromfile %1     

By the way, do go out of your way to find the version of LAME that is compiled for your specific CPU.  My Q6600 does VBR2 at 28x.  I literally cannot rip as fast as it encodes from CDs.  (Note: while there is a multi-threaded version, mp3 encoding is really a single-threaded operation, so quad-core just means I can encode 4 streams at once.)


Filed Under: Programming

I've Been Wondering...

by fwhagen Tue, 10 February 2009

Why are Unicorns hollow?


Filed Under: Life

Book Review: Beyond the Blue Event Horizon - Frederick Pohl (1980)

by fwhagen Wed, 28 January 2009

Sometimes I think this site is turning into a Book Review site instead of a technical site.  And in support of that concern is Beyond the Blue Event Horizon, book 2 of the classic Heechee Saga of Frederick Pohl.  While Gateway is a very different read, the second of the saga promises to be a bit odd, but more mainstream than its predecessor.  And is just so.

We join Robinette Broadhead again, but only as one of the primary players in the story.  More closely we follow the expedition to another artifact dubbed the Food Factory located in the Oort Cloud.  The expedition indeed finds a food processing facility but cannot get it to move closer to inhabited space.  They also find a surprising inhabitant:  A teenaged boy stranded there since birth.  Or rather stranded there and at another location they call Heechee Heaven.  And there the surprises are even greater.

The Heechee Saga is nearly as important to Science Fiction as the Foundation Trilogy and 2001 and its sequels.  If you read Dune and the Ringworld stories, you should read these.  But having said that, the books really are not that great to read.  The stories and the ideas in them certainly are, however, and has shaped much of modern SciFi.  At least in my mind.  Even 30 years later, I still think the AI entities in the books as pretty accurately modeled.  And his treatment of the vast distances within our own solar system is very refreshing.  I am really enjoying re-reading the series, although, I don't believe I have ever read the remaining books.  I am doing so now, but have also picked up some other material as well, so it may be awhile.

UPDATE: When writing up the sequel, I noticed I posted the wrong title for this book. It is now corrected.


Filed Under: Books

DateTime in IIS Logs Using LogParser

by fwhagen Fri, 23 January 2009

Everytime I need to render date and time to a DateTime field, I have to scour the Internet to figure out how.  Well, here is how:

If you need to get hourly statistics on your website, select and group by the following metric:


This will properly combine date and time and offset by the correct timezone to a single datetime field recognized by most data parsers.  And it will look like this:

2009-01-21 12:00:00

It shouldn't be too difficult to change that to minutes, seconds, periods, whatever you need.


Filed Under: LogParser

Inauguration Day 2009

by fwhagen Wed, 21 January 2009

And so, today we begin the four years of our Great Nation's biggest electoral mistake.

I truly hope I am wrong.


Filed Under: Politics

C# Business Objects and CSLA.NET

by fwhagen Thu, 11 December 2008

I am learning and working with a Business Objects framework at work called CSLA.NET (Component-based Scalable, Logical Architecture).  It is built heavily using the best of OOP especially polymorphism and abstraction.  You build your objects all based on a handful of base classes that provide a huge variability of useful features.  It also abstracts out data and .NET remoting layers to make the developers life easier.  If you are building large, scalable n-tier applications, you should definitely look this one up. 

Also check out the book Expert C# 2005 Business Objects, which is the companion to the framework.  If nothing else, it contains a great description of n-tier architecture and why to use it.


Filed Under: .NET

Book Review: Gateway - Frederick Pohl (1977)

by fwhagen Thu, 11 December 2008

Ah, the classics.  Occasionally, I will go back and re-read a book I haven't picked up in decades.  Gateway is such a book.  It has been so long, I couldn't even remember the plot.  Oh, I remembered the premise alright, but the details of the plot were lost to me.  This classic of Sci/Fi has spawned sequels, imitations and a pretty decent (1992) computer game. 

Gateway is the story of a reluctant explorer in the hunt for Heechee artifacts.  The Heechee were a race of ancients that left a space station, dubbed Gateway, complete with several hundred FTL ships.  Once discovered, they were quickly experimented with to find that although no one could figure out how to program them, random combinations of the controls would send a ship out and return to Gateway automatically.  Untold riches awaited volunteers who could ride the ships and return with more artifacts, if any are to be found.  Of course, many dangerous and fatal things were on the other end of the trips, and chnaging the controls mid-flight meant certain death.  Our hero is one of the volunteers who must overcome his very reasonable fears and make some trips out.

Gateway is told from a split perspective.  We know that the protagonist is ultimately successful, as he is very wealthy and undergoing therapy, the primary vehicle of the plot.  However, the therapy hints at horrible trauma and the deaths on his conscience.  The well executed plot leads to a suspected, yet surprising ending that is very satisfying.  There are many reasons why this is a classic, and well justified.


Filed Under: Books