Archive for the ‘Geek’ Category

Fun with AVIs and VCDs

Thursday, August 5th, 2004

When my father-in-law was going in for his bypass surgery, he had wanted to watch the TV show 10.5. But due to his surgery, he missed it. So, being the world’s best son-in-law, I decided to see if I could help.

I downloaded and installed a BitTorrent client, and found that someone had recorded the show in two avi files. Each was 750+ megs. So I found the .torrent and started the download.

The download was _very_ slow. I saw my list of connections and each had a bright yellow circle next to it. Same color as a yellow smiley face. I assumed it was A Good Thing.

A couple of days later, in aggravation at the super-slow download rate, I started looking through the documentation. Oops, the yellow circles indicate that something is wrong with my firewall setup. Changed my router configuration to pass through the right port to my laptop. The download took off, and I was finished very soon.

Cool, so now I have two AVI files. Now what?

First I played them in WinAmp to make sure they weren’t corrupted - good, no problems.

In retrospect, at this point I should have bought a cable (more on that later), hooked my laptop to my VCR, popped in a blank tape, played the movie through WinAmp, and sent the tape to my father-in-law.

I don’t have a DVD burner, but I knew that I could burn a VCD that would play in my and my father-in-law’s DVD player. So all I needed to do was turn an AVI to a VCD.

I noticed was that the AVIs were larger than a CD would hold, so I also need a way to split the AVI file.

Since this was a one-time thing, not an ongoing need, I didn’t want to spend any money, either.

So I start surfing and come across VirtualDub. It will allow you to edit AVIs. So I installed it and loaded the first AVI.

What’s that? Something about a variable bit rate being rewritten. *Shrug*, whatever. OK. Split the file into several parts, and save them. That wasn’t hard.

Now, how do I burn an AVI as a VCD?

A little more searching reveals this nifty program called Nero, with a 30 day trial period. So I installed it and burned the VCDs.

I put the VCD in my DVD player to watch it. No good. The sound was way off the video. I guess that’s what the variable bit rate thing was all about. Throw the VCDs away.

A little more searching revealed a program called VirtualDubMod, which is just a slightly modified version of VirtualDub. I used it. This time, it gives you the option of whether or not to rewrite the header due to the variable bit rate. OK, so I’ll say no, don’t rewrite it. I repeated the previous few steps.

This time, not only was the sound skewed, the disc itself just froze up. Hmm, that’s no good.

About this time, a little guy named Nicholas came into our lives. Put the project on hold.

My in-laws came to visit, and I tried some of those things again. No luck. I was disappointed, so I decided to improvise. I went to Wal-Mart of find a cable that would allow the AV out of my laptop to connect to the AV in of my VCR, so we could watch it that way. Nothing fit the bill at Wal-Mart, but fortunately there’s a Radio Shack right next door. Got there at 5 minutes to close, and the guy knew exactly what I needed. Victory!

I returned home and set the laptop up to play through the VCR. No signal. Fiddled with the monitor control panel, got that working, cool.

Unfortunately, we only managed to watch half of the movie. Everybody fell asleep. We didn’t get to finish watching it before my in-laws left.

But now, see, it’s personal.

Oops, now my Nero demo has expired and I can’t figure out how to do a clean uninstall/reinstall. I couldn’t find anything in the registry or anything like that. So scratch using Nero.

When I load the AVI in VirtualDub, it says something about the variable bit rate and an option to save the audio track to a wav file. Let’s see if I can figure that out.

Go to the streams list, hit “Save to WAV”. It saves a big file, but it still wasn’t right. Hmm. Oh, I see. First change it to “Full Processing Mode”, THEN Save to WAV. Cool, now I have two 750 MB AVIs, and a 900 MB WAV (for the soundtrack to the FIRST half only).

Alright, now how do I put these together? Oh, I see, add the WAV as a stream, and disable the AVI sound. Cut the file in half, save it as two AVIs. Two huge AVIs, 600+ MB each.

Now what do I do with them? I can’t find anything else for free to burn AVIs to a VCD. Maybe if I convert it to an MPEG first.

A program called TMPGEnc will do just that. But it runs just a bit slower than real-time. So I fired it up, loaded the first AVI, saved it as an MPEG.

45 minutes later I had an MPEG, and 45 minutes after that I had another. Now, how to burn them to a VCD?

Here’s a program called VCDGear that will turn an MPEG into something called a cue/bin or a toc/bin. Let’s give that a shot.

First one worked fine, but the second one didn’t. Something was wrong with the way the MPEG was “packed”. Grrr… Hey, what’s that option? MPEG to MPEG conversion? Well, let’s try it. I fed the second MPEG through, got another MPEG that was slightly larger, but this time it didn’t give me any error.

Now I have a cue/bin file pair. How do I burn _that_?

Google turns up something called burnatonce. Load the cue file into burnatonce, tell it to write to my CD, and off it goes.

I now have two of the four VCDs theoretically created; we’ll see if they play correctly when I get home tonight.

To recap:

1. Load the AVI into VirtualDub, and save the soundtrack as a huge WAV file.
2. Load the AVI and the WAV together, split the AVI in half, and save the two AVIs.
3. Run the new AVIs through TMPGEnc to produce MPEGs.
4. Run the MPEGs through VCDGear to produce cue/bin files.
5. Use burnatonce to burn the cue/bin files to CD.

Again, I should have just bought the special cable, played it through WinAmp, recorded on my VCR, and mailed it to my father in law. But where’s the fun of that?

Intellectual Property

Tuesday, April 6th, 2004

I very rarely blog about technical things. But I am, after all, a geek by nature and by profession.

I used to think of intellectual property as a pretty black-and-white issue. Downloading music is just like stealing. Copyright infringement is always bad. Intellectual property is just like tangible property.

But then I read Lawrence Lessig’s latest book, Free Culture. You can read the book for free on-line, as I did. If so, please consider purchasing it as well. I’m adding it to my Amazon wish list.

Lessig hits a lot of related points in his book, but here are some things that stood out to me.

Intellectual property is not the same as tangible property, at least in the Anglo-American legal tradition. English law in the late 1700s formally established that copyrights were only for a limited time. The US Consitution clearly treats intellectual and tangible property differently. Congress is explicitly granted authority to protect and regulate intellectual property. No explicit authority is given to protect tangible property. It’s pretty clear that our Founding Fathers did not consider them to be the same. IP is only protected for a limited time (theoretically, although extending copyrights every few years is indistinguishable from “forever” in my mind).

Even if intellectual property _was_ the same as tangible property, and it’s not, property rights are not absolute. We don’t live in a libertarian utopia. In this world, you give up some of your rights, including some of your property, to participate in society. Taxes are the most obvious example. Also consider, young men can be drafted to fight and die in a war. Your land can be seized under eminent domain. A wide variety of laws and ordinances, from zoning regulations to environmental protection laws, can restrict your rights to control your own property. If it is in the best interests of society to do so, your rights to your property can be infringed.

The Constitution provides for the protection of intellectual property to _promote progress_. The most natural way for progress to happen is if someone can make a buck from it. I write a book, I sell a book, I make money. But, this also means we should evaluate our IP laws to see if they are promoting or hindering progress. There is a balance that must be struck, which is why the Constitution does protect intellectual property, but only for a limited time.

Most intellectual property stops producing revenue for its creators within a few years. At that point, progress is no longer promoted by protecting this property. Progress can only be inhibited by it. Our IP laws should be structured around the period of time a work is actually making money for its creator.

The IP battle is being fought on several fronts, ranging from cases of simple copying, to producing derivative works. Lessig chronicles several absolutely silly cases in which ip laws hindered the creation of new creative works. He also explains why “Fair Use” is fairly useless in these cases.

Our laws also ought to make a big distinction between how IP is used. If I make a copy of a CD for my own use, that’s entirely different from reselling copies of a CD to the general public. It’s also different than making a derivative work (say, a parody) and selling that. There are lots of points in between these exremes, and the law should regulate some cases much more strongly than others.

And finally, we have to decide as a society just how much collateral damage we’re willing to accept in the fight over intellectual property. There is good evidence that even p2p file sharing (like Napster) does little, if any, economic harm. But the fight to shut down these IP violations may well do lots of harm by stifling creativity and the economic benefits that go along with that. We should not use a shotgun to kill a mosquito here.

Go read the book. It’s 300+ pages, but well worth it, and it goes quickly. It certainly helped me understand that there’s a lot more involved here than a black-and-white case of “stealing music”.