How to add a composite video out to a TV tuner card ?
Warning:
By modifying your TV card you will loose your warranty. You should read through every passage and follow the instructions step by step. Of course Iīm not responsible for any damage that could occur by using this guide. Donīt blame me if you blow up your PC because you soldered your cable to the wrong pin.
At first I would like to say that this is not originaly my idea. Some time ago there was a discussion on a german video editing board on how to "extract" the TV signal from a TV card and to feed it into a MPEG hardware capture card (the Dazzle DVCII). Unfortunenatly the guy who made this proposal didnīt answer to my questions and so I had to find it out the "hard way".
Those of you who use their TV card also for direct capturing might find this a stupid idea but itīs suited to other needings. I made this "howto" for people that want to use their TV card as a tuner for an additional capture card (may be a MPEG or MJPEG capture card). The biggest bonus of this construction is the controllability of a TV card. You can easily control your TV card via any scripting language (Windows Scripting Host, Winbatch, etc). Switching channels is a quite simple task using WSH.
But now back to practice:
Step 1: Letīs find out the model of your tuner. May be you have to remove some stickers. On my Hauppauge WinTV Primio FM the following was written:
Philips 3139 147
FM 1216 13381C
SV23 0032
Itīs best to write down all this text. Now we have to look at this ftp server. Youīll find some subdirectories called Temic or Philips.
Now look for some file called as your tuner (in my case FM1216). Download the PDF doc.
Step 2: Letīs locate the pin layout and number of your tuner.
Thatīs how it looked for my tuner. Look after something thatīs called "Composite Video Signal Output" (or something like that). Iīve drawn a red square around the row of the table. The pin number is also important (Pin 23 for me :).
You can easily find the exact position of the pin on the tuner schematics (marked red again). Also very important here: The four mounting tags called TH1, TH2, TH3 and TH4 at each corner of the tuner. They are the ground for our composite signal.
NOTE: From the soldering side the layout is flipped. So donīt solder to the wrong pin.
Thatīs how my soldered cable looked like. Pretty crappy I know.
I used two small zip-ties to "connect" the cable to the tuner. Iīve drilled a small hole in the back of my TV card to put the cable trough. A small knot before this hole saves the cable from slipping out.
Now we are finished.
Here you can see my modified TV card connected to the video input of my Asus V6600 Deluxe. Doesnīt make sense to you ? Well, for me the Asus ADC provides better capturing quality than the BT 878 chipset and my Asus has a quite powerful compression codec (Asus Video 2.0). Also the WinTV was cheaper and more universal than the Asus TV Box.
How to control your TV card by using the Windows Scripting Host (WSH)
A lot of people asked on this stuff. So I decided to write some more infos. Please note that I canīt teach you programming Visual Basic here. Some basic knowledge is needed to understand how this works.
Of course you should have the latest version of the scripting host on your system and you should be aware that installing the scripting host makes your system vulnerable to script viruses. So use at your own risk !!!!
OK, ask yourself: How do you use programms ?
Thatīs pretty basic: Launching a programm and doing keystrokes & mouse movements/clicks
Now, we have to let the PC do our work.
1. Start the programm. Here itīs the TV application provided by Hauppauge for their WinTV series called WinTV2k.
In VB Script we launch a programm like that:
set osh = wscript.createobject("wscript.shell")
osh.run
"C:\winapp\wintv\wintv2k.exe -c2 -mOff",0
Great, now you might ask yourself about this "-c2 -mOff" stuff. Iīll explain this now:
-c is a parameter for the WinTV application. It sets the channel number written behind. "-mOff" switchs the application off after setting a channel.
so "wintv2k.exe -c4 -mOff" sets channel 4 and closes WinTV2k.exe afterwards.
Note: This works only for Hauppauge based TV cards. For other TV cards you have to figure out this yourself although most TV apps have hotkeys. If your TV app is only mouse controlable then try GhostMouse.
We all know that it takes a few seconds (depending on your system) to launch a programm. So itīs better to wait a few seconds after setting the channel before we launch (for example) Virtual Dub for capturing. This is done by the "sleep" command.
wscript.sleep 10000
This lets the script wait for 10000 ms(=10 seconds) until it continues.
Hereīs the rest of my "record" script:
set osh = wscript.createobject("wscript.shell")
osh.run
"C:\winapp\virtualdub\VirtualDub.exe",0
wscript.sleep 2000
osh.sendkeys
"%F{p}"
wscript.sleep 2000
osh.sendkeys "%C{e}"
wscript.sleep
2000
osh.sendkeys "{F2}D:\CAP_1.AVI{ENTER}"
wscript.sleep
2000
osh.sendkeys "%C{c}"
Basicly it does the following things:
Look on the hyperlink below for the "sendkey ()" syntax and the available keys.
The good thing here is the flexibility of this method. For example:
Iīve switched to a MSI GeForce3 Ti200 VTR with Video In & Out that has WDM drivers and doesnīt work with Virtual Dub. There was a nice tool included called "Wincoder" that does Realtime MPEG2 encoding software based with a very nice quality. For Wincoder "home" starts recording. So I only had to change the script above a little bit in order to control Wincoder instead of VDub:
set osh = wscript.createobject("wscript.shell")
osh.run
"C:\Programme\InterVideo\WinCoder\WinCoder.exe",0
wscript.sleep
8000
osh.sendkeys "{HOME}"
Pretty hard, isnīt it ? :)
OK, depending on your applications and your system specs you might have to play around a bit with delays. I strongly suggest that you get a book on WSH programming if you want to go deeper into this stuff. For experienced programmers itīs easy to do a small frontend (in Delphi or VB) that creates a small script and launchs it timer based.
Oh, I nearly forgot: Of course you have to write another script for stopping Virtual Dub and closing it.
Here we go:
option explicit
dim osh
set osh =
wscript.createobject("wscript.shell")
osh.sendkeys "{ESC}"
wscript.sleep
2000
osh.sendkeys "%F{x}"
wscript.sleep 2000
osh.sendkeys
"%F{q}"
wscript.sleep 1000
Use this as base for further experiments.
Youīre not limited to WSH. Also other script based languages & tools work for this. There are a lot of them out there: WinBatch, Macro Scheduler, etc.
Some additional hyperlinks:
Documentation on the sendkeys() routine (URL might change with a new version of the scripting host)
Anything on WSH and VB Scripting
Micro$oft VB Scripting Documentation (URL might change with a new version of the scripting host)
May the source be with you :)
You can find more informations on TV cards at tv-cards.com