Wednesday, October 19, 2005

Closed Captioning in TV cards

Well, after all the effort here is a summary.

Closed captions: Used for the hearing impaired. contains not only dialogue, but also actions and other sounds (eg 'door banging', 'singing'). Closed Captions is transmitted as text.

Subtitles: Used only as an aide for clarification of dialogue, or for translations from another language. Contains only dialogue and no extra information. Subtitles are saved as images that are overlayed onto the video being played.

So, the PVR-350 was purchased since the 250 was sold out. Here's what I discover. The tv signals contain closed captioning (when available) in line-21 of the signal. Higher end cards tend to throw this away and concentrate on higher line decoding for improved audio/visual performance. The 250/350 is the only card which saves this line into the mpg2 file. Other cards will display closed captions on live tv because they can read this line, but they will not save this line. Some lower end cards, however, do save these captions as text (eg. ati tv wonder).

So, I have the mpg2 saved with line 21. Windows media player wont display it because it only decodes subtitles, not closed captions. Same for my dvd player, and most dvd players in general. ofcourse, some dvd players can play closed captions, but this is rare. And since closed captioning is a typically american phenomenon (like teletext is european), the chances of playing back closed captioned mpg2 files in non-american dvd players is near zero.

How to convert line 21 closed captions to subtitles? Well, I found that there is no one program that performs this task, however there are a group of programs which can be used to accomplish this. Why an all in one program which utilised these freeware programs hasn't been programmed is beyond me since the community seeking this solution is not completely insignificant.

First step, use the program "MPG2SRT" in order to extract the line 21 text in .smi and .srt format (only the .srt will be used, you can discard the .smi). To do this place the mpg2srt program in same folder as mpg file. Use dos prompt and go to folder. syntax is "mpg2srt inputfile.mpg", it will output .srt and .smi files with the same name as 'inputfile' (i.e. It should be noted that provided this file is in the same folder as the mpg file, installing "vobsub" will automatically display these subtitles in windows media player (or any other player). So this is a neat solution for windows.

The next bit is about how to place these into the mpg file as subtitles, so that they can play back on any dvd player. Use the program "SubRip" (v1.40b2 in my particular case) to convert these files from .srt to .ssa format. Click the "show/hide subtitles text window", "file/open", choose .srt file (e.g., click done, click "choose output format", ensure SubStationAlpha (ssa) is selected, click "convert to this format", click "save as" and choose file name. congrats, you have the subtitles in .ssa format (simply another text format... silly really, but necessary).

Now use the program "MaestroSBT" to convert the .sma file to a .sub file with a bmp image for each caption (one heck of a lot of files.. such a pain!). When opened, choose the .ssa file. Then in the program click "set files" and choose to save as .sub (submux). Click "rendering" and ensure the output resolution is the same as the mpg file (i.e. dvd, svcd and ntsc/pal etc., google to check correct resolutions just to be sure). Click "timing" and choose the correct fps in/out (29.97 for NTSC - this is important to get the timing right!). edit if you like, then click "generate".

Congratulations, your folder should now be filled with a whole bunch of crap. If you look, the .bmp files are the subtitles. Now, we need to shove these files into the mpg2 file. To do this you use the "WinSubMux" program. Click "input file name" and choose the mp2 file you wana do. output file will now automatically read the same, however with 'subbed' appended. Click whichever stream you want the subtitle to be muxed into and click the folder button. Choose the file you just made with maestrosbt. Click "load all" (i think this may be optional) and look at the preview if you like (load all takes a long time). Go back to first tab and choose the correct type of subtitles you want (svcd etc). Now click "multiplex" and wait for a loooong time to get it muxed. when done you can delete all the crap you created.

Congratulations, you now have subtitles where you previously had closed captions!! For fonts, colours etc just mess around with the relevant programs during the process. don't forget, if you just wanna view the recorded captions in media player you can use mpg2srt and vobsub for a quick fix.

Monday, October 03, 2005

Here's something interesting we don't think about every day. How small, exactly, is a nanometer? A nanometer is a thousand times smaller than a micrometer, which is itself a thousand times smaller than a millimeter. Very small indeed, but is it possible to visualise what a nanometer is? Is it possible to make this meaningful? For everyday purposes it is sufficient to think of this as being infinitely small, but let's have some fun and try to imagine.

Take a strand of hair in your hand and examine it carefully. That strand is around a hundred micrometer thick, i.e. 0.1 mm. Aha, so now thinking about micrometers doesn't seem so ridiculous. Look at your hair again, and imagine something a hundred times thinner, e.g. a sliver of hair. If you imagined this, then you succeeded in imagining the size of a visible photon. That's correct, the wavelength of visible light is from around 0.4 -0.7 micrometers. These are the photons which we can see with our naked eye. Photons which have a wavelength of less than 0.4 micrometers are called ultraviolet (and x-ray), and photons which have a wavelength larger than 0.7 micrometer are called infrared (and microwave). Ultraviolet and infrared photons are not detected by the naked eye. It actually surprised me when I realised that we can visualise the size of a photon. Now consider again the 1 micrometer photon you imagined, and remember that a micrometer is a thousand nanometers. Congratulations, you've just visualised 1000 nanometers. That is incredibly small. But we can do better!

The width of an atom is 0.1 nanometer. Let us assume that it is not feasible to create wires or miniature robots with only electrons, protons etc. This is justified because such structures would not have energetically stable configurations, i.e. such structures would rapidly fly appart. So we are restricted to manufacturing objects using atoms which can form molecules and more complicated structures. Then we can arguably state that the nanometer regime is the floor on how small mechanical structures can be. A red blood cell is around 10 micrometers wide. The typical E-coli bacterium is about 100 nanometers wide, while the rhino virus is about 10 nanometers wide. All of these cells contain DNA, the code of life, which has a width ranging from 1-5 nanometers. This is the smallest that nature has managed to shrink structures, and is remarkably at the limits of the best that we could expect to achieve. DNA uses chains of 4-5 different molecules (chemically bonded atoms), where each molecule consists of only 5-10 atoms, hence the very small width. So, if you can imagine a strand of hair, then imagine a red blood cell that is ten times smaller than the hair, then imagine an ecoli bacterium inside the cell, then a virus inside the bacterium, and finally the DNA strands inside the virus; if you succeed in imagining this, then you would have succesfully imagined the nanometer scale!

Let us briefly explore some technological achievements in this new light. We can currently purchase computer chips which consist of wires that are only 90 nanometers wide, i.e. the size of bacteria, or a few hundred atoms wide! With the current rate of miniturization, the famous Moore's law, these structures will shrink to the size of single atoms or molecules within 10-20 years. In other words, if the size of these structures halve every year, then what is a width of 900 atoms today will be a width of 1 atom ten years from now. At that time the art of computing will need a shift in paradigm simply to cope with the quantum effects which will be observed at such small scales. Luckily, however, this new paradigm should allow us to exploit these quantum effects in order to obtain significantly higher computational power.

Another incredible technological achievement is the discovery of carbon nanotubes. These are carbon-based tubes that are only 1-10 nanometers in width and 1-10 micrometers in length. What is incredible about these tubes, apart from their small width, is that the entire tube consists of a single fused carbon molecule, i.e. one big molecule! This gives the nanotube an incredibly strong structure as well as impressive conductive properties. These nanotubes are currently only used to reinforce mechanical structures, however there is much hope for more sophisticated applications in the future.

Hopefully this discussion will have provided some insight into the range of scales which are involved in our research, and perhaps inspired some wonderful ideas which you are more than welcome to email to us. As before, all questions, comments, and concerns are welcome.

Further reading:
If possible take a look at the excellent interactive animation at the following website which provides further insight into the nanometer scale:

Monday, September 26, 2005

TV cards

I found out the ups and downs of tv cards the hard way. From all my research I found that software cards will mostly display captions through the VBI pin, however whether this is encoded into the mpg2 or not depends on your software encoder (duh). However from what i've read, all software encoders do not do this. A way around this is to save the captions as text files and use an overlay program (ffdshow, vobsub) to display the captions on playback. Not an elegant solution, and not a very portable one.

So, hardware encoder cards have better quality because they put fancy filters on them as well. I know because i tried out the wintv-go as well as the ati 550 pro, and the ati was clearly clearer (pun intended). however, i discovere, again the hard way, that even hardware encoder cards do not necessarily encode the subtitles. It seems so trivial, therefore something any $100+ card should have, yet it isn't. After much painful research I discovered than only the Hauppage PVR-250 cards have captions encoded within them. Hence, I will be looking for a good deal on this card for the next few weeks. Lets see what I get.

In the meantime I'm also considering an upgrade for my computer..

Powered by Blogger

[ View Guestbook ] [ Sign Guestbook ]