View Full Version : Capture area confusion


superblast
22nd March 2004, 02:36
I just did the capture area test that Arachnotron wrote up on his website and I want to make sure I'm understanding things right. I've got a Pixelview XCapture card with uses the CX23881 chip. When I try to capture video at 720x480, I end up with about 688 pixels across instead of 720. Is there anything I can do to capture the other 32 pixels or is this set by the driver?

Arachnotron
22nd March 2004, 10:36
Yes, this is set by the driver. With the BT878 chip (the CX23881 predecessor) you had the option of using the BTWincap drivers and the BTtweaker in Vdub to influence things, but sadly that wont work with the CX23881.

I would not agonize over this though. 688 DVD pixels equals an capture area of 51.0 µs. The active area for NTSC is 52.66 µs theoretically, which equals about 712 DVD pixels.
So you only miss out on about 24 pixels of info. That is only 3%. Anything beyond 712 DVD pixels would end up as extra black pixels in your cap, so you are missing nosthing there.
And that is if the NTSC source follows the standards (or one of them, ITU BT.470. There are more standards, NTSC is a bit of a mess standards wise :) ) Many NTSC sources contain even less active area.

So don't worry about it, just correct for it.

If your target is DVD, just cap at 688x480, and letterbox (=add black bars on the sides) untill you reach 720x480. The resulting DVD will have correct Aspect ratio, and you won't even see the black bars on TV since all of it is in the overscan area of your TV set anyway.

superblast
22nd March 2004, 14:34
Ah, thanks Arachnotron, that makes me feel better. :)

Okay, I just want to make sure I totally understand this. I did two other captures with your grid test DVD (one at 704x480 and the other at 640x480). In all three cases, the same amount of information was captured. In other words, each image displayed pixels 13-701 on the grid but the 704 and 680 images were "squished" versions of the 720 image. But, you are saying that all three are incorrect, right? The most accurate representation of the original analog video with my card would be 688x640. The 720x480 and 704x480 images are stretched compared to the correct aspect ratio and the 640x480 image is squished (compressed) compared to the correct AR.

So much to learn, so much to learn!

Arachnotron
22nd March 2004, 15:07
Okay, I just want to make sure I totally understand this. I did two other captures with your grid test DVD (one at 704x480 and the other at 640x480). In all three cases, the same amount of information was captured. In other words, each image displayed pixels 13-701 on the grid but the 704 and 680 images were "squished" versions of the 720 image.

Correct.

But, you are saying that all three are incorrect, right? The most accurate representation of the original analog video with my card would be 688x640. The 720x480 and 704x480 images are stretched compared to the correct aspect ratio and the 640x480 image is squished (compressed) compared to the correct AR.

Correct depends on what you want to do with your cap.

My example was only valid for the case where you want to create a valid mpeg2 file for DVD authoring with correct AR.

Capping at 688x480 would give you pixels with the same PAR as DVD pixels, so you could make one without resizing.
(PAR is the aspect ratio of a single pixel, AR is the aspect ratio of the whole picture)

http://www.iki.fi/znark/video/conversion/
Is an excellent place to start.

Perhaps it is easier to use sample rate.

Small example:

Say you want to make a S-VCD. From the table on this link you know that that is 480x480, and that those 480 horizontal pixels reprecent 53.333 µs and the sample rate is 9.0

Your card will only cap 51 µs. So, how many SVCD sized pixels fit in there? 51x9=459 pixels.
That is not a nice number to cap. Depending on the codec, you should always cap mod 2, 4 or 8. For instance, I think Huffyuv will not let you cap MOD2.

So you have two options here:
1. Cap pixels that are at or close at the target size. So, try capping at 460x480 and letterbox to 480x480 (460 is mod 4)
You are still one pixel off in AR, but should be ok.

But also possible would be:

Capping at another resolution and resize to the correct pixel size afterwards. If you want that, cap high, say 720x480.
However, your card caps only 51 µs, so you need extra pixels to make up the difference with the 53.333 µs a SVCD needs for correct AR. How many?
(53.333 / 51 ) x 720 = 752 in total.

So, add 32 extra black pixels to both sides of your 720x480 cap. (16 on each). You now have 53.333 µs worth of info in 752 pixels. Resize the resulting 752x480 horizontally to 480x480 and again, you have SVCD with correct AR.

Which way you choose depends on how the numbers work out and at what resolution your app/codec can capture.

As you can see, correct for capping is a relative thing. What matters is if your pixels are correct for the target format when you are finished resizing and cropping.

trevlac
23rd March 2004, 14:39
I think Arachno explains it well, but I can't help chimming in. :)

I think the hardest part for people to get their brains around is that more pixels (which are essentially the same as samples), does not mean you've captured more picture. Maybe think of it as compression. 720=less compressed. 352=more compressed. Same analog picture width. The trick is that DVD/SVCD/etc require a specific analog picture witdth (line length) and a specific number of pixels per line (sample rate). You use 688 to match the DVD sample rate, and pad to adjust your capture cards line length to get the standard DVD line length.

PS: You should always have a height of 480. Also, you can pad to 704 for DVD. This would save some space. Finally, if you watch on a TV, you'll never see the stuff on the edges. The TV has a thing called overscan, which effectively crops (about 5%) from each side.

fellaw
24th March 2004, 00:04
I've got to put my oar in to this. There's something missing in your calculations, which IMHO might be important, too. Have you considered the Kell Factor yet? Normally, the Kell Factor only concerns TVs using CRTs. But because of the Kell Factor, the bandwith/frequency used for the width had been limited by the CCIR in Europe after WWII.

Because of the final diameter of the ray , only 374 of 576 lines can be definitely differed from each other: ~0,65(Kell Factor) x 576 = 374.
The maximum bandwith used for the width is 768 columns / 2 x 52µs ~ 7,4 MHz. Keeping the 4:3 ratio in mind, only 0.65 x 7.4 MHz = 4.81 MHz had been necessary during those years.

The limits were set differently depending on the country: France: 6 MHz, UK 5.5 MHz and Germany 5 MHz.

Now there goes the calculation, in my case, Germany: 5 MHz x 52 µs x 2 = 520 columns.

This gives an effective resolution of 520x374 pels! Thinking of this, a higher resolution doesn't make any sense, because the analog signal doesn't carry more information than this! Maybe the technique got better during the years, but there are still some PAL modulators out there which additionally set their own limit of 3.5 Mhz! Maybe the TV-Cards out there sample more information, but couldn't it be containing white or brown noise?

Btw, VHS has a "resolution" of 3 MHz, S-VHS has 5 MHz.

I don't know about NTSC, maybe it doesn't have such a limit.

Please don't hesitate to correct me if I'm wrong!

Arachnotron
24th March 2004, 01:31
@fellaw

err... I disagree. Completely. Where to start... :D

You are confusing bandwidth with sample rate. Those are completely different things.

Sampling rate has to do with converting an analogue signal into samples (pixels in the case of video) and with converting pixels back into an analogue signal again when you play back on a (DVD) player.
It takes 52 µs to draw a PAL video line. To convert it to pixels you need to sample. The more samples you take per second, the more pixels you have representing this same 52 µs. Higher sample rate = more pixels representing the same analogue picture

Bandwidth has to do with the frequency-range an analogue signal has to cover in order to be able to carry a certain amount of fine detail. Finer detail gives higher frequencies gives higher bandwidth.

Kell has to do with how much of this detail can be distinguished when you feed this analogue signal to a TV set. It only comes to play during playback.

A SVCD is played back with 9 MHz. That is in the specifications.
So, 9 milion times per second a pixel is converted to a voltage. (that is simplifying things a bit but essentially correct for this argument)

Doing this during 52.66 microseconds will convert 9 milion pixels per second x 52.66 µs = 474 pixels. If you keep on playing for 53.33 µs (the duration of a SVCD signal) you convert 53.33 x 9 = 480 pixels to an analogue signal. Kell does not enter into it at all at this point.

Now, whether the resulting analogue signal will result in all 480 pixels being distinguishable from each other on the TV screen is another matter. Because of limitations in the CRT this might not be the case. It is only at this point that the Kell factor does come into play. But for creating an in-spec SVCD this simply does not matter.

And even here you must take into account that older Kell factor values of 0.7 might no longer apply to modern, partly digitally enhanced, TV sets (leaving alone things like TFT)

Mind you, the discussion in this thread was on how, given the capture window of a capture card, do you cap and resize in such a way that the resulting SVCD has correct Aspect Ratio. Whether or not your source has enough detail to warrant this resolution is not the issue here.

By the way, I am wondering where you got your numbers from.

-576 is the number of active lines in the PAL frame.
-768 is the number of pixels you need on a 52 µs PAL line in order to get 768x576 square pixel on a computerscreen. (i.e. the resolution at which the standard PAL active frame has correct 4:3 AR on a compter screen). Nothing at all to do with analogue video or broadcast bandwidth.
- My impression of the various broadcasts bandwidths was (but I may be wrong there) that they represent various compromised between the amount of detail desired and the number of channels countries wanted to cram into a given frequenty range. More channels close to each other gives less bandwidth per channel.

As to the minimum capping resolution needed to cap PAL:

First, capping devices process video line by line. So you have to cap at 576. If you dont, the card will still cap 576 lines but resize afterwards to the vertical resolution you picked. Cards have lousy vertical resizers, and it really screws up interlacing. Don't do this!

We are digitizing. So we need sample rate again, and Nyquist. (not Kell). Germany is PAL/B and G. Bandwidth for video is indeed 5 MHz. According to Nyquist, we need at least 2 samples per cycle to be able to reconstruct the signal on playback of the captured file. This is a minimum, and subject to the restriction that:
1. the source is low pass filtered to samples rate/2 (anti aliassing, anything above 5 MHz must be filtered out before digitizing)
2. On playback, an ideal recontruction filter is used. (long story, and I am not the one to explain this :) )

So, to sample broadcast, I need a sample rate of at least 10 MHz but if my DVD/VCD/SVCD/(fill in your own)/ player is not perfect (and no DVD player is) I might even need more! So I need at minimum: 10 MHz x 52 µs = 520 samples horizontally. So you did got the number right. ;)

Minimum capture res needed for PAL B/G broadcast : 520x576. Maybe even more to reproduce the signal correctly on playback.

Now, the broadcast may not really use all available bandwidth, in which case you can use a lower hor res.

I hope I explained things a bit. It is difficult to get into this without writing a complete manual on analogue video in the process.

fellaw
24th March 2004, 07:13
Maybe my post was a little bit wrong in this thread. However, I made a new (http://forum.doom9.org/showthread.php?s=&threadid=73226) one to you a clue what I was thinking of.

superblast
24th March 2004, 16:10
I know Arachno wasn't intending for his webpage to show differences in image quality but I couldn't help but notice that the Philips card appears to have better quality image than the BT chipset cards. It also seems to capture the same window as DVD (53.33 µs). I understand how television overscan makes the differences in capture area somewhat irrelevant but I'm going to be spending a lot of time transferring VHS/Beta/LD material and wouldn't mind spending a bit more to get a Philips based card if that'll give me an improved picture. Any thoughts?

BTW - I intended to start this project over a year ago when I bought a Canon DV camcorder to do the transfers. Then I learned how DV is a 5:1 compressed format. And, there's apparently an issue with Canon's in terms of it's luminance range (16-235 vs 0-255). I noticed that my transfers looked good but a little washed out and I read that it was because of the Canon's luminance range. So, now I'm sort of starting from scratch and thought I'd give the XCapture card a try since I already had one for my HTPC.

Arachnotron
24th March 2004, 23:11
I know Arachno wasn't intending for his webpage to show differences in image quality but I couldn't help but notice that the Philips card appears to have better quality image than the BT chipset cards. It also seems to capture the same window as DVD (53.33 µs). I understand how television overscan makes the differences in capture area somewhat irrelevant but I'm going to be spending a lot of time transferring VHS/Beta/LD material and wouldn't mind spending a bit more to get a Philips based card if that'll give me an improved picture. Any thoughts?

The Terratec device shown on my page uses an Philips SAA7113 chip. This is a somewhat older chip, and it's comb filter is not up to modern standards. Not an issue with S-video sources, but important for composite sources (and TV)

Apart from that: the reason the Terratec looks so good is because it is capping a DVD source playing on my DVD player. Both this device and the DVD have an active area of 53.333 µs. So at 720x576, every pixel it caps happens to align perfectly with a pixel on the DVD.
With the BT878, because it caps a smaller window then a DVD, some pixels are perfectly 'aligned' under a pixel in the DVD, while others are not. This gives rise to blurring. This does not say anything about the performance when capping an analogue source like VHS or TV.

Don't get me wrong, I really like Philips chips and I think they get an undeserved bad wrap from the BT878 crowd. :) But you should never judge the quality of a capping card by it's performance when it is capping a DVD source.

For the rest: if you want to go Philips, go for an SAA7134 based card. Better comb filter, and dead cheap. Asus has one, Terratec has, Medion has, Flyvideo 3000 I think etc. etc.

[edit]A cap at 720x576 on the terratec, a cap of 702x576 for the BT878 and a cap of 696x576 for the CX23881 would all look pretty much the same when depicted in this way. ( (if you could find a codec that allowed you to cap at mod 2 for the BT878)

superblast
25th March 2004, 01:25
Originally posted by Arachnotron
This does not say anything about the performance when capping an analogue source like VHS or TV.

Since you're using the analog output of the DVD player, wouldn't that give you a pretty good idea of what a VCR or television cap would look like?

Could I record your test DVD pattern to S-VHS videotape and then play that back and capture it with the card to see if it gives different results?

Anyway, thanks so much for your insight Arachno! I've started looking into Philips cards and it appears that there is actually a 7133 chip for NTSC cards (7134 is PAL). Hopefully, I can find an Asus card with composite and S-video in because I've liked their products in the past.

Arachnotron
25th March 2004, 12:27
Originally posted by superblast
[B]Since you're using the analog output of the DVD player, wouldn't that give you a pretty good idea of what a VCR or television cap would look like?

DVD produces an extremely clean, well synchronised high bandwidth signal with a chroma resolution that is several times larger then that of VHS or broadcast. It does say something about card quality in general of course. But especially with VHS you have low bandwidth, noise, bad sync causing dropped frames etc. This can maka a difference.

My testpics contain only single pixel white lines on a gray background. This favours caps that happen to be at the same samplerate as the source DVD and gives no info about color handling, which is just as important.

Could I record your test DVD pattern to S-VHS videotape and then play that back and capture it with the card to see if it gives different results?

Of course you could. The results would look much worse. But I would suggest using various video sequences and perhaps a broadcast test image for comparison.

Source quality plays a bigger role. But if you own a S-VHS you seem to have that covered.

[edit] I should perhaps mention that my biggest reason for the SAA7134 was it's ability to capture PAL60, i.e. NTSC tapes played on a PAL VCR.