Oldskooler Ramblings

the unlikely child born of the home computer wars

Archive for the ‘Digital Video’ Category

If you focus your energy like a laser, you can do anything!

Posted by Trixter on December 13, 2009

It has taken me decades to understand my own behavior.  Saving you the lengthy self-analysis, I can sum up most of my actions as a reaction to negative stimuli.  No control over my social environment?  Learn to program computers, who always do what I say.  Can’t afford games?  Get a job at the local software store, then learn to crack and courier warez.  And so on.  Most of my hobbies can be traced to events like this.

So what happens when the negative stimulus is gone?  It depends on the hobby.  I don’t pirate (new) games; like movies, I can now afford to purchase or rent them.  I’ve stopped collecting hardware and software because I no longer have a need for the comfort and security that familiar things bring.  As I get older, I find I am finally able to let go of everything that gave me short-term benefits but led to longer-term detriment (collecting software is easy; collecting hardware takes up a ton of space!)

Finally, some of my championed causes have come to fruition and matured:  MobyGames remains the only organized, normalized database of computer and videogames, run by many volunteers.  MindCandy 1 and 2 have taken a small slice of hidden skill and wit and preserved it forever.  DOSBOX exists, and does a (nearly) fantastic job of making DOS games playable, and my efforts combined with others have gotten the games out there.  I’ve made some of my friends laugh with my programming ideas.  That’s a lot of personal accomplishment for someone who has to put family first and work first, and I’m happy thus far.

So.  The time has arrived to shore up and buttress the hobbies.  Here’s the Trixter 5-year pledge, to me as much as to you, in order of project start date:

  1. Finish up MindCandy 3.  Four hours of home theater showcase material on tasty Blu-ray (DVD too).  It’s 80% done and should be ready by March or April.
  2. Complete The Oldskool PC Benchmark, a project I’ve been tossing around for a while.  I’m unhappy that no PC emulator is cycle-exact for any model, not even known fixed targets like the 5150/5160, so this benchmark should help emulator authors get that taken care of.  It will maintain a database of systems that have been tested, so that users and authors of emulators can target a specific model to run programs in.  As each system I own is benchmarked, it will be donated back into the collector community, save for a handful of machines that I need for further development work (see below).
  3. Gutting and rewriting MONOTONE.  Adding features people actually need (like volume and frequency envelopes, or an interface that doesn’t suck ass) as well as a few only I need, like flexible hardware routing.  Remember, kids: You’re never going to wow the pants off of people unless you can drive seven(*) completely different soundcard technologies all at the same time.
  4. Bootable diskette PCjr demo, using the PCjr’s enhanced graphics and sound.  Hopefully presented at a euro party.  You best step aside, son.
  5. Build the Soundcard Museum, another project I’ve been tossing around for quite a while.  (Now you see why MONOTONE enhancements came before this.)  This will take up many months of free time, but I promise it will be worth it for the soundcard otaku.
  6. …and that’s it.  I have nothing else planned.  If they’ll have me, I’ll return to working at MobyGames, with maybe another MindCandy project in the works, if the project doesn’t run out of money.

And between all of these projects, I will play longform games that I’ve been meaning to get to (Mass Effect, Red Faction: Guerrilla, Fallout 3, etc.).  Because I’m good enough, I’m smart enough, and doggone it, people like me.

A keyboard exclusively for programming in binary

Air-cooled coding keyboard for professional use

(*) It is technically possible to put a Sound Blaster 1.0/1.5 (CMS+Adlib), Bank Street Music Writer card (essentially a PC Mockingboard), LAPC-1, IBM Music Feature Card, and SCC-1 into a Tandy 1000-series computer if you take the cover and metal frontplate off to allow room for the full-length cards and configure the LAPC-1 and SCC-1 so that they don’t share the same port and IRQ.   That’s six technologies — the seventh is the Tandy 1000 itself, with its SN76496 3-voice squawker.  If I had a 5161 expansion unit for the 5160, I could become more evil — it adds 7 additional ISA slots to the 7 already in the 5160.  I’d lose the 3-voice Tandy, but the additional slots would allow for adding up to three more IBM Music feature cards and an additional Sound Blaster Pro 2.0, and maybe even an additional SCC-1 (I’d have to check what settings it supports).  But I don’t have a 5161; they’re ludicrously difficult to find complete.  And besides, once you have two SCC-1s in a machine, what is the point of driving anything else?

Posted in Demoscene, Digital Video, Gaming, Lifehacks, MindCandy, MobyGames, Programming, Vintage Computing | 11 Comments »

Tips for making your own demodvd

Posted by Trixter on August 24, 2009

I responded to a pouet bbs post recently and thought that the information could help more than just the demoscene, so I’m reproducing and expanding on it here.

As always, some quick background so information below makes sense (if you’re already familiar with the demoscene, skip to the next paragraph):  I’m making a Blu-ray + DVD package called MindCandy Volume 3 that showcases 30+ Windows demos, which in addition to extremely high-quality video will include commentary by the original authors and other fun bits.  Demos are computer programs that showcase the author’s programming skill and creativity, and are usually awesome to look at and listen to.  Demos run realtime (they do not output their graphics+music to output files), which means you need a special capture program to “hook” into the demo and redirect its output to a series of bitmap files+.WAV or .AVI, and the best utility for doing so is kkapture.

Now that that’s out of the way, the question asked was how to get the most decent quality demo footage onto a DVD.  Having had a lot of experience in this area, here are my tips for doing so:

  • Capture the demo in the highest res it allows.  Even if your target is 720×480/576, do it, because the resizing and anti-aliasing will result in less high-contrast transitions which compress better and with less artifacts.
  • Never add filters in any step of the production chain, not even a sharpening filter.  All they do is cover/obscure picture detail, not enhance it.  You can’t create detail that isn’t there, so don’t try.  See previous tip.
  • Preconfigure your graphics card to forced “quality” settings (on my GTX card I’ve been selecting 16xQ anti-aliasing and turning off all texture compression because my card has nearly a gig of vram).  Sometimes this bugs a demo; if so, go back and kkapture it again with more modest settings, but at least try the best settings.
  • Resample down using the best possible resizer that is time-practical (ie. avisynth spline64 or equivalent — bicubic/lanczos are good but can result in ringing, so always inspect your results).
  • Capture in real video rates if you ever want to display on a TV without dropping or adding frames.  This means you enter rates into kkapture like 60000/1001 (NTSC) or 50 (PAL).
  • If you’re putting multiple demos on a dvd, make it one giant output so that 2-pass/n-pass encoding can spread the bitrate appropriately across all the demos.  Yes, it takes longer.  Yes, it is worth it.

And here’s the part people most people forget:

  • If making a dvd, deal with interlacing because a demo at 24/25/30fps really sucks compared to a demo at 50/60fps, and the only way you’re going to get 50/60fps out of a dvd is an interlaced video.  One of the hallmarks of demos as an art form is the nature of having been created on a computer for a computer, and part of that art is a display rate of 50 or 60Hz.  Arbitrarily limiting a demo to a lower framerate when it was created for higher is just wrong.  If a demo is created specifically to look like film, that’s one thing, but limiting it because you want less data to process is a crime.

As for what maximum (not average!) bitrate to choose, you must always choose the maximum (9800), and even then you will find that some demos will have compression artifacts simply because there is too much picture information changing from frame to frame.  This is something I had to come to terms with for MC3 (we’re including a DVD of the main program with the Blu-ray for those who want to upgrade later).  The only way to make it better is to give the encoder less frames for the bitrate — meaning, if 30i or 30p footage has artifacts, feed it 24p.  The DVD and Blu-ray specs were tuned mostly for real-world footage at film rates, something that has made working with 720p/60 footage so painful.

While the above tips were windows-centric, they apply to any type of demo DVD you may work on.

Posted in Digital Video, MindCandy, Technology | 3 Comments »

Supercharging The Free Time

Posted by Trixter on July 23, 2009

One month ago, I started work at my new job, a trading firm in Chicago. I live in the western suburbs, so I have to take a train in to the city. The train ride is only 35 minutes each way, but due to a bus hookup that I have to make, as well as my scheduled working hours (trading hours), I spend a little over an hour on the homebound train. All told, I spend 1h45m sitting still on a train each day. This is time I used to spend computing, which is why people haven’t heard from me in a while. 

With a new job comes some new pay, so I considered it an investment for my sanity to purchase a laptop for the train. All the time I spent waiting to arrive home can now be spent working on projects and answering email. For someone who commutes so much, and has The Combine™ at home to crunch HD video (more on The Combine™ later), I initially thought that I would grab a tiny Dell notebook; they have a supremely tiny 9” model for $300 that can run for hours on fumes. Less to carry, good enough for syncing email for offline review, and I could even surf if I had to (via USB tether to my smartphone). They even come with a choice of shipping with Ubuntu.

The only problem with that idea is that the #1 project I have to focus on, with a deadline no less, is MindCandy volume 3. MC3 poses some significant challenges for me:

  • We have no dedicated DVD/Blu-ray author this time around (Jeremy is working full-time for Futuremark/Sony), which means I have to author it myself
  • The footage is a mixture of 720p (main program) and 1080p (special features)
  • The combined footage (special features + main program) is over 15 hours long
  • We don’t have any graphical artist for the motion menus, which means I have to design/create/render them myself (if you want to volunteer then by all means please contact me!)

MC3 post-production is essentially a one-man show, as you can see above. And with over 2 hours a day LESS free time, I am understandably nervous about getting it done before the end of the year, as is traditional so that you can snag it as a holiday gift. So, I have to work on the project on the train, which means the laptop would have to run Adobe CS4… and would have to play back HD video, including 1080p… and be able to render 3D graphics for the menu work… and it would have to hold at least 300G of low-res proxy footage video data (the real video footage is over 2 terabytes). So the tiny notebook idea was out.

Hey kids, how do you take a normal laptop and turn it into a Blu-ray production powerhouse?

  • Install nothing less than a Core 2 Duo
  • Replace the 720p LCD with a 1920×1080 LED-backlit full-gamut RGB screen
  • Put in a 500G hard drive
  • Upgrade the RAM to 4G
  • Swap out the DVD burner for a Blu-ray reader
  • Shame the embedded Intel video controller and install a Radeon HD 4570 with 512M dedicated video RAM
  • More power means more juice, so toss the 6-cell battery and install the 9-cell model

So that’s exactly what I did, taking a Dell Studio 15 that normally goes for $750 and injecting it with all of the above, then applying a magical 25%-off-anything-with-an-obscene-cost coupon. Final damage was around $1200. Yay Dell credit!

Here I am, laptop the size of a planet, and all I’ve done is write a blog post.

Man, this thing is heavy.

Posted in Digital Video, Lifehacks, MindCandy, Technology | 5 Comments »

Editing HD On a Budget: Cost of Entry

Posted by Trixter on March 3, 2009

Blu-Ray Disc (BD) is expensive to produce.  As previously ranted by a good friend of mine, the minimum cost to produce a BD is a whopping $4600 — $3000 for some licensing cost that goes who-knows-where, and $1600 for a sanity-defying mandatory AACS encryption procedure.  And this is before you press a single disc.  (If you’re wondering why content producers were rooting for HD-DVD to win the format war, it’s partially because of licensing fees like this, plus lower manufacturing costs.  The cost of entry was much lower compared to BD.)  Needless to say, we have to be very careful how we produce MindCandy 3, because these licensing costs automatically take a giant chunk out of the resources we have available.

And what are those resources?  I’ll describe our budget thusly:  Dan and myself put up the initial capital in 2000, with the hope that we would at least make it back, as well as some extra that would fund a second volume.  That second volume would sell, which would make just enough for the third volume, etc.  The goal from the beginning was to try to have the project generate the money it needed to keep going for as many volumes as possible.  When we found ourselves with a little extra, we donated it to scene.org, or sponsored some demoparties.  When we found ourselves a little short, we did everything we could to keep costs down.  This is no different than the reasons why people organize demoparties, really;  for example, Scamp wants Breakpoint to be successful enough so that, instead of losing 10,000 euros, he can break even and put on another party next year.  The goal is equilibrium.  For the first two volumes, we achieved it.   Now, with BD having such a giant up-front cost, that equilibrium is in jeopardy and forces us to look at alternative ways of producing volume 3 so that we don’t run out of money before it’s ready!

There are many places where money goes in the production of any end-user product, but they tend to fall into the following buckets:

  1. Development
  2. Pre-Production
  3. Production
  4. Post-Production
  5. Distribution

Luckily for us, some of these buckets have no cost other than our personal time.  Development and Pre-Production are all organizing and research, which we do for free because we like doing it.  Thanks to the demoscene community, Production also has no cost as long as we get permission from the authors.  Post-Production involves a hardware and software cost (storing, editing, mastering, and authoring the footage onto media), and Distribution is a setup fee, a per-item manufacturing cost, and shipping costs.  (We also budget for the free copies we set aside to everyone who authorized their demo to be included, provided commentary, donated time or materials, or helped us out in some other way.)

The Distribution cost, thanks to the ass-tastic licensing I mentioned previously, is relatively fixed.  The Post-Production costs, however, are not, and this is where demoscene sensibility comes into play:  How can we make the best of what we’ve got?  What can we pull off, given the limited resources available to us?  It’s time to make a demo — using budgets!  A budgetro, if you will.

In a later post, I’ll start diving into the gritty details of how we’re able to edit HD footage at less than 1/100th the cost of how production companies normally edit HD footage.  Stay tuned.

Posted in Digital Video, MindCandy | 12 Comments »

The Great Television Migration

Posted by Trixter on January 14, 2009

I ran across an interesting topic today in one of of the mailing lists I subscribe to:

Why have TV when you can stream anything you want any time you want from the internet?
Where is the place for it, and advertising when you can download shows for free, or close to it?

As a video content producer who has researched online distribution,  I feel somewhat qualified to answer.  You may disagree, but it makes for interesting speculation.

First of all, you can’t currently stream everything for free.  Less than 3% of all major networks’ shows are available online from the networks (ie. legally).

Secondly, TV won’t die any time soon, but is changing into a quasi-music-industry model.  Meaning, pop music artists today hardly make any money off of their CD/online store sales; instead, they make their living from live shows.  From the standpoint of the artist, all of the radio play and CD sales are “advertising” to go see the live shows.  (This is not the standpoint of the publishers, which I will tastefully not comment on in this post.)  So how is TV like that?  In the case of television, shows like Heroes, 30 Rock, and CSI are available online 1-7 days after the broadcast.  When you go to watch them online, you are treated to advertising — but unlike broadcast television, there is no way to skip the advertising, as the DRM’d player won’t let you.  (No doubt hackers will find a way around this, but for now, that’s the case.)  To broadcasters and advertisers, a single advertisement that you cannot skip is worth a dozen that you expect the user to skip with VCRs and DVRs.  In these shows’ cases, the broadcast brings in advertising dollars, sure, but more serves to drive the user online, where distribution can be audited (think Neilsen ratings with a much larger sample size) and other company offerings can be promoted (like DVD sets) without cutting into broadcast time.  There is a very large market for DVD sets of shows, and as long as the set contains extra materials (commentary is usually a requirement), the set can sell to a customer even if they have watched all of the shows online.

There is a tipping point, but we won’t get there until high-speed broadband becomes a utility in every home (ie. 6mbps or greater, enough to support picture quality identical or better than broadcast SDTV).  The only reason it is happening at all is because networks are trying to reclaim their user base.  Perform an inventory of all of the shows being offered online and you will find that, almost universally, they are shows that are followed by the technologically savvy.  Putting nerd-centric shows like 30 Rock and Heroes online makes sense because that is more of where those shows’ viewers are anyway (“I spend more time on the computer than on the couch”).  Conversely, putting shows online like talk shows or old reruns doesn’t make sense, since the viewership of those shows is primarily non-technical or lower-income and wouldn’t have broadband.  (One of the few exceptions to this are soap operas, because each show of a soap is broadcast only once and is not repeated/re-run.  Putting them online gives viewers a second chance to catch up on the story in missed shows, which gives the broadcasting company a second chance to earn advertising revenue.)

My prediction is that the future of traditional broadcast television will ultimately be determined by the future of online/digital copyright law.  But that’s a topic for another day.

Posted in Digital Video, Entertainment | 1 Comment »

The Next Big Thing

Posted by Trixter on January 12, 2009

As some followers of a certain thread on pouet might have guessed, the MindCandy crew has started production on MindCandy 3.  This time around we’re mixing the familiar with the unfamiliar:  We’re revisiting the PC — specifically Windows  — but unlike any other demoscene project, we’re doing it all in HD.  That’s right:  MindCandy 3 will be Blu-Ray.

Oh, we’re going to make a DVD available as well, don’t worry.  In fact, we’re tossing around the idea of including the DVD in with the BD, so that there’s only one package to get and you can enjoy the BD when you eventually upgrade your hardware.  Nobody gets left in the cold, and the demos get the proper treatment they deserve.  And it’s one hell of a treatment; thanks to kkapture, we’re able to get clean and pure video from most demos, 60 frames per second, at 720p.  For those who hate interlacing artifacts, this is the fastest progressive video specification HD supports. For some demos (like Into The Pink), the video exceeds what most 2008 machines are capable of.

Work on MindCandy 3 actually began before MindCandy 2 was finished.  In mid-2003, a good friend of the project, Steinar H. Gunderson, worked with us to create “demorender”, which did exactly what it said it did:  Hooked DirectX 8 and 9 calls to grab the data from a frame, dump it through a VFW codec, and then continue, all the while faking the timer so that the demo would be fed a constant timebase.  We were able to capture around 50% of the demos out there when ryg announced kkapture in 2006 and we found that, right off the bat, kkapture did everything our tool did.  We weren’t ready to begin MC3 at that time — and farbrausch is, well, farbrausch — so Steinar contributed the source code of demorender to ryg to fill in a hole or two in kkapture (I believe it was in .wav writing or something but I’d have to check the sources to be sure).

Fast-forward to 2008, and we start to get the MindCandy bug again.  We were in the middle of tossing around ideas to cover, when Blu-Ray finally won the HD format war, and we took that as a sign that that’s what we should target.  The first MindCandy, which was in production from 2000 to 2002, came right at the cusp of the DVD revolution; it was the right product at the right time, and as a result, it did well and the demoscene gained some new converts.  We’re at another cusp:  HD video.  We’re excited to work in that medium and we hope that we can live up to the standards set by MC1 and 2.

While the www.demodvd.org website will remain and start to get updated as we get rolling, I’m moving the Developer’s Blog over here, because this space is an actual blog and not some Python code I slapped together.  I’ll tag them appropriately, for those who want to follow only MindCandy development.

Because part of capturing HD material is making sure you have an HD monitor, I have one now.  Unfortunately, I can’t stand how my 1920-wide window displays a 640-wide skinny little blog in the center, so I will be checking wordpress.com every week to see if they have a theme available with a flexible width that doesn’t royally suck.

Posted in Demoscene, Digital Video, Entertainment, MindCandy | 12 Comments »

Using A Sharper Stick

Posted by Trixter on November 22, 2007

I met with Brian the other day to help out with some MobyGames infrastructure activities and we rekindled the idea of allowing video submissions. These could be actual videos of gameplay, or video reviews, or commercials… but before we work all that out, we have to work out how feasible it is from a technical standpoint. Which gives me yet another excuse to toy with video :-)

Before we posed our own internal technical questions, I decided to try to figure out how YouTube was encoding their videos, so that we could have a baseline to work from in terms of user expectations. The viewing public seems to accept YouTube as generally “watchable”. If MobyGames were to implement video, it would have to be at least as decent as YouTube.

So we’ve got a few questions to answer here: What video and audio codecs is YouTube using? What parameters (approximately) is YouTube using to encode video?

Thankfully for me, my friend Mike Melanson has already answered most of these questions: It’s Flash video, using Sorensen Spark (h.263 with some limitations) for video and MP3 for audio. To determine the encoding parameters, I grabbed a few .flvs from YouTube and ran “ffmpeg -i myvideo.flv” to see what ffmpeg could glean from the file format, and it identified the audio stream as 22050Hz audio, 1 channel (mono), at 56kbps. But it couldn’t identify the video stream other than to tell me it was indeed using flv’s limited h.263. I asked Mike how he thought it was being encoded, and also what best practices were.

“No idea; I’m not really that much of an encoder guy.” Luckily, I am.

The first thing I wanted to determine was how the bitrate control was. Was it quality-based or bandwidth-based? I encoded two test videos, a simple one (few changes per frame) and a complex one (many changes per frame), both one minute in length. (By the way, I noticed a few people other than Mike and myself doing this, with names from the innocent “video quality test” to the unabashedly-named “ffmpeg FLV encoding raw audio mux test”.) After letting YouTube encode them, I sucked the end results back and immediately it was apparent that the encoder was bandwidth-based because both file sizes were identical. If it were quality-based (“constant quantization” for the encoding nerds out there), the simple file would have been substantially smaller.

After figuring this out, of course I had to determine what that constant bitrate setting was. After some manual binary partitioning trials, I narrowed it down to 240kb/s. Matching youtube’s 56kbps mp3 audio and encoding my originals, a setting of 240kb/s for video resulted in nearly the same filesize as the encoded YouTube .flvs.

I was happy with this until I actually viewed my encoding results, which looked substantially worse than YouTube’s files. It took a few more viewings of the “simple” example before I noticed that the YouTube video had a very long GOP (group of pictures). Meaning, a very long time went by before the entire frame was repainted with a keyframe. In my trials, my keyframe was changing every 15 frames; that’s twice a second @ 30fps. Since intraframes (keyframes) are much larger than interframes (frames where only the differences are stored), this was eating up my bandwidth, and visual quality suffered. I was able to determine YouTube’s intraframe interval by staring at a static section of the “simple” file, hitting a stopwatch when it changed, then hitting the stopwatch again when it changed again. I measured 8 seconds, which is 240 frames @ 30fps. Setting the GOP to an interval of 240 frames, my encoded files now matched YouTubes’ results. For the video encoding nerds out there, I can even see some of the same DCTs being used in the same places :-)

If you want to reproduce YouTube encoding yourself, possibly to see how your encoded video will look on YouTube without waiting for the upload+processing, grab yourself a command-line version of FFMPEG and use this syntax:

ffmpeg -i (inputfilename.whatever) -s 320x240 -b 240kb -ab 56kb -ar 22050 -ac 1 -g 240 (outputfilename.flv)

I’m sure it’s not 100% complete, but it certainly gets you 98% of the way there.

Will MobyGames improve on this? Most likely. For one thing, I didn’t agree with the decision of limiting everything to mono sound. For the typical YouTube talking head over laptop speakers, it makes perfect sense, but for stereo video game music or positional sound effects, it doesn’t. I was also not happy with the video quality at 240kb/s because, for fast-moving sources like FPS games, everything becomes a blocky mess. We will also probably come up with some convention (read: Encode It Yourself Dammit) for frame sizes over 320×240, like games that run 640×480 and are simple (ie. have very little motion or changes between frames). One of the “obvious” optimizations that turns out to be not so obvious is 2-pass encoding to spread out the bits more optimally, but this was only a benefit (in my tests) for complex sources. It actually made simple/static sources more blocky in the static parts.

After all this discovery, I was bothered by something. Check YouTube’s parameters again:

  • 240 lines (framesize is 320×240)
  • 240 kbps (video bitrate)
  • 240 frames in a GOP

I’m a big fan of Occam’s Razor, but I was depressed to apply the Razor here because, after doing so, it sure seems like the YouTube guys were taking blind stabs at encoding parameters (ie. “Hey, let’s set everything to 240 and see what happens!”).

Posted in Digital Video, MobyGames | 14 Comments »