The Modules – Capture

Capture

This module is a Visual Basic 6 application (I’ll port it to C# and .NET as soon as I reach a decent level of functionality with the rest of ZTV) that uses DirectShow to capture, compress and save TV shows. The format used to store the captures is Windows Media 9.

Why Windows Media? Why not, say, MPEG2 or DViX?

Well, wmv files (produced by the Windows Media 9 Encoder) are smaller and look better than both MPEG or DViX. Given that I’m not planning a cross platform version of ZTV, it’s a reasonable solution. Especially considering that MPEG2 encoders are NOT freeware and DViX consumes too much CPU during compression. Yes, I have an Athlon XP1800+, but it’s not guaranteed to be on my final machine, remember I want a quiet PC 🙂

DirectShow, included in DirectX 8.1, provides a complete and efficient API to write the capture module. The actual main program is just 70 lines long (included comments) plus other 140 lines for implementing a proper delay function that uses CPU cycles in the most efficient way possible. So few lines of code means that there are not many places where something can go wrong and I’m reasonably confident about the reliability of this module.

That, by the way, is finished and working beautifully.

Leave a Reply

Your email address will not be published. Required fields are marked *