Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Capturing Video

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th June 2005, 22:01   #1  |  Link
lcld
Registered User
 
Join Date: Jan 2005
Location: France
Posts: 28
What resolution should I capture at ?

I have Leadtek WinFast TV2000 XP Expert and I've always captured at the maximum resolution (768x576) with huffyuv. I capture from both the tuner (analog tv) and composite (dvb-c modem => 720x576 ?).
For the vertical resolution, it's ok : 576 (pal).

However, for the horizontal resolution, the cx2388x chip really seems to capture at a lower resolution and just deliver a resized frame. Or is it due to the source (tuner or composite) ?

I really have the impression I would get better results if I capture at lower horizontal resolution (720 or even 480) since I could compress at higher bits/pixel.

I tried to find an answer at http://www.doom9.org/capture/start.html -> 384 ??? Disappointing...

Here is an example of a tv capture (raw Y plane) : -- removed --

If AR signaling (mpeg4 bitstream) wasn't so problematic, I wouldn't hesitate so much. Only the combination of VMR9 and ffdshow seems to handle it, with one exception : mplayer. BSplayer seems to be buggy and doesn't resize the window automatically. VMR9 is slower than overlay mixer mode 2 on my computer

Last edited by lcld; 9th June 2005 at 01:10.
lcld is offline   Reply With Quote
Old 8th June 2005, 03:19   #2  |  Link
hartford
Registered User
 
hartford's Avatar
 
Join Date: Nov 2003
Posts: 324
I would capture at the "native" resolution.

For example, I capture analog NTSC. I do it at 640x480, then I resize to
720x480 to make it DVD compatible.

I have done captures at 720x480 with the same card that you have and I
found that the capture looks better when done at 640x480 and then resized
to 720x480 using avisynth filters. That card does appear to do a resizing from a
lower resolution to a higher one; it looks bad to me.

I suggest that you experiment.

I have tried "half-resolution," ie 352x480, and I did not like the result.

Best.
hartford is offline   Reply With Quote
Old 8th June 2005, 13:56   #3  |  Link
zilog jones
Registered User
 
zilog jones's Avatar
 
Join Date: Mar 2004
Location: Ireland
Posts: 481
I think Arachnotron (or someone around here) did tests with the cx2388x and found that 696x576 is the optimal resolution for capturing with it, and I got very good results using that and just adding borders the left and right sides to make it 704x576 (a DVD-compliant resolution).

Most analogue capture cards capture somewhere around 704 pixels horizontally - the Philips-based cards for example do 704 exactly. Hartford, I don't know where you're getting 640 pixels as the "native" resolution...
zilog jones is offline   Reply With Quote
Old 9th June 2005, 01:09   #4  |  Link
lcld
Registered User
 
Join Date: Jan 2005
Location: France
Posts: 28
A note about the resolution I want to encode : there is none. I have no constraint. No DVD. I encode with xvid and I would never watch the result at horizontal_zoom=100%. I also think any resize filter before encoding is a bad thing.

@hartford
"native resolution" ?
You seem to ignore the output resolution of the source : a dvd player, a VHS, a PC at 320x240 (err ok, nobody would use it today ).
What I mean is that there may be limiting factors at different steps of the chain. How much information can :
- carry analog TV (in France) ?
- carry a composite link ?
- deliver the TV tuner and more generally my TV card ?
I am also surprised you get better results with 640x480+resize than with 720x480. Which filter do you use ?
OT: What software do you use to capture ?

@zilog jones
For example, Determining the capture area of a capture card and Capture Resolution - Are you sure? ?
Yes, these are very interesting topics and I haven't finished to read^Wdecipher them.

For my part, I tried a more practical way to determine the resolution. For a DVD/VHS source, it is easy to experiment by displaying a special pattern. For TV, appart from theory...
What about a spectral analysis of a frame ? Using a tool like Audacity ? Strange ? Stupid ? Oh... I dare

Here are the analysed frames for the TV tuner (vertical black borders -> no discontinuities at line returns) :
- 768x576 : Y plane - 170 kB, U plane - 48 kB, V plane - 44 kB (and the resulting RGB picture - 556 kB)
- 480x576 : Y plane - 120 kB, U plane - 35 kB, V plane - 33 kB (and the RGB - 386 kB)
- 384x576 : Y plane - 104 kB, U plane - 31 kB, V plane - 29 kB (and the RGB - 332 kB)
- spectral analysis - 712 kB
lcld is offline   Reply With Quote
Old 9th June 2005, 14:41   #5  |  Link
zilog jones
Registered User
 
zilog jones's Avatar
 
Join Date: Mar 2004
Location: Ireland
Posts: 481
Quote:
Originally Posted by lcld
@zilog jones
For example, Determining the capture area of a capture card and Capture Resolution - Are you sure? ?
Yes, these are very interesting topics and I haven't finished to read^Wdecipher them.
Yes, those were the topics I got that imformation on, though they get pretty technical. Generally, it seems if you go too low a resolution (e.g. around 352 or lower) the capture cards will use low-pass filters, so you may lose a lot of detail, and if you go too high (e.g. over 704) you may start losing quality as well.

The 696 thing was found out after a lot of tests and calculations and whatnot. I really recommend trying 696x576, then resizing to whatever you want.
zilog jones is offline   Reply With Quote
Old 9th June 2005, 16:34   #6  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
About native resolution:
Quote:
The 696 thing was found out after a lot of tests and calculations and whatnot. I really recommend trying 696x576, then resizing to whatever you want.
The capture window is 51.56 µs (see table in section 5.4) which equals 696 DVD pixels since 51.56*13.5=696 and 13.5 MHz is the sampling rate of your dvd player.

So, this means if you want to encode to dvd the best is to cap at the native resolution (ie 696 pixels) and add black border to get 720 pixels (or 704 which is also allowed). It is the best because you don't need an extra resize. Whether or not it is possible to cap at an arbitrary size depends on your capture card/driver.

If you want to encode to XviD/DivX you can do two things:

1) cap at the right size without the need for an additional resize:

Look at the table in section 5.2.1, the sample rate is 14.769 µs (standard: PAL TV on a PC), which equals 51.56*14.769 = 762 pixels. So you need to cap at 762x576 without the need for an extra resize.

If you want to have a lower size (because you want to choose a low encoding bitrate), just calculate the new horizontal size. For example you want to have 480 pixels vertically. This implies 480/576*762 = 635 (636 to make it even; because your cap size should always be even).

So, just cap at 636x576 and resize to 636x480. If needed you can add pixels to get a size divisible by 16 (codec requirements).

2) cap at a high size.

Just cap at 720x576 (or whatever you prefer).

However, your card caps only 51.56 µs, so you need more pixels to make up the difference with the 52 µs a PC needs for correct AR. How many?

(52 / 51.56) * 720 = 726 in total.

So, add 6 black pixels to your 720x576 cap. You now have 52 µs of info in 726 pixels. Resize the resulting 726x576 to 768x576 or a scaling of it (say 640x480).

I hope it's a bit clear Don't forget the look at the examples in section 5.6.

Quote:
However, for the horizontal resolution, the cx2388x chip really seems to capture at a lower resolution and just deliver a resized frame. Or is it due to the source (tuner or composite) ?
No, it doesn't. It samples at 35.48 MHz (see 5.2). It always samples at a fixed rate and downsizes to the requested capture size.

Quote:
I really have the impression I would get better results if I capture at lower horizontal resolution (720 or even 480) since I could compress at higher bits/pixel.
The capture and encoding quality are two different things. At the end it all boils down to the encoding bitrate you choose. If it is very high you can encode at 720x576 if it is very low you should encode at 640x480 to get similar quality.

Quote:
I have done captures at 720x480 with the same card that you have and I found that the capture looks better when done at 640x480 and then resized to 720x480 using avisynth filters. That card does appear to do a resizing from a lower resolution to a higher one;
It doesn't, because the sample rate is 28.64 MHz for NTSC. Could you provide pics for yours statement?

Quote:
For my part, I tried a more practical way to determine the resolution. For a DVD/VHS source, it is easy to experiment by displaying a special pattern. For TV, appart from theory...
See table section 3.5. But you can check yourself using test charts
Wilbert is offline   Reply With Quote
Old 9th June 2005, 18:10   #7  |  Link
lcld
Registered User
 
Join Date: Jan 2005
Location: France
Posts: 28
Quote:
Originally Posted by Wilbert
Whether or not it is possible to cap at an arbitrary size depends on your capture card/driver.
Yes, I wonder if I can. Leadtek's software only lets me capture at 768, 720, 704, 480, 384 and 352 (x576).
Quote:
See table section 3.5. But you can check yourself using test charts
-> TV(PAL/SECAM L) 470 / 6.0 / 12.0 / 624
And what about composite ?

No comment about the spectral analysis. Captures don't seem to carry so much information. I would say... between 300 and 400 pixels.
lcld is offline   Reply With Quote
Old 9th June 2005, 21:18   #8  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
-> TV(PAL/SECAM L) 470 / 6.0 / 12.0 / 624
And what about composite ?
The resolution of your source doesn't depend on the composite/svideo signal type. The main difference is the luma/chroma separation. For composite the luma and chroma is not separated with the consequence that you can get artefacts when the capture card separates them (using a comb filter).

More info in section 9.3:

http://www.doom9.org/index.html?/cap...gue_video.html

Quote:
No comment about the spectral analysis. Captures don't seem to carry so much information. I would say... between 300 and 400 pixels.
I didn't look at it Could you explain the pic a bit, for example how do i read of the frequencies? I guess the intensity of the colors or so, what's the scale of it?

Btw, you used Audicity to make a spectral analysis of a video frame?
Wilbert is offline   Reply With Quote
Old 9th June 2005, 22:32   #9  |  Link
lcld
Registered User
 
Join Date: Jan 2005
Location: France
Posts: 28
Quote:
Originally Posted by Wilbert
The resolution of your source doesn't depend on the composite/svideo signal type.
Surprising I don't get better results from a DVB-C modem then.
Quote:
The main difference is the luma/chroma separation. For composite the luma and chroma is not separated with the consequence that you can get artefacts when the capture card separates them (using a comb filter).

More info in section 9.3:

http://www.doom9.org/index.html?/cap...gue_video.html
Ok.
Quote:
I didn't look at it Could you explain the pic a bit, for example how do i read of the frequencies? I guess the intensity of the colors or so, what's the scale of it?

Btw, you used Audicity to make a spectral analysis of a video frame?
Yes, Audacity. The scale is linear : for a 44100 Hz audio track, it goes from a few Hz (bottom) to 22050 Hz (top), with 11025 at the middle.
I saved each plane as a raw file (first line, the one at the top of the image, followed by the second, etc. until the bottom one) that I imported as a raw sound - 8 bits unsigned - mono. Line returns may introduce high frequencies but there are vertical black borders in the samples.
lcld is offline   Reply With Quote
Old 10th June 2005, 11:57   #10  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
I thought DVB-C modem was for digital tv? Btw, resolution is not the only thing what determines the quality of your capture.

Quote:
Yes, Audacity. The scale is linear : for a 44100 Hz audio track, it goes from a few Hz (bottom) to 22050 Hz (top), with 11025 at the middle.
You are talking about an audio spectrum here. That has nothing to do with the resolution of you video. Perhaps i'm misunderstanding you.

Btw, there's a VDub plugin which shows the spectrum of the video, so that you can see the resolution of it. I will post about it on sunday/monday.
Wilbert is offline   Reply With Quote
Old 12th June 2005, 04:30   #11  |  Link
lcld
Registered User
 
Join Date: Jan 2005
Location: France
Posts: 28
Quote:
Originally Posted by Wilbert
I thought DVB-C modem was for digital tv?
Yes, but it's a hired (and quite old) modem with only a Peritel SCART connector. It doesn't even output a S-Video signal
Quote:
Btw, resolution is not the only thing what determines the quality of your capture.
Huh ? For the capture ? That's the only parameter I can act on...
Quote:
You are talking about an audio spectrum here. That has nothing to do with the resolution of you video. Perhaps i'm misunderstanding you.
AFAIK, there is nothing in an "audio spectrum" that is specific to audio data. It justs performs a FFT. When I load the video in Audacity the way I described, I just get the signal that has been sampled by the capture card, don't I ?
But I must admit I don't know how to read what I see in Audacity.

I tried something else. A big fDCT on a frame. A 768x576 matrix. No need to say this is insanely long to compute
I wrote an Avisynth filter with the following functions :
- FDCT takes a YUY2 video, performs the fDCT and returns a clip with the same properties.
- IDCT is the opposite of FDCT
- FDCT2 : since a linear scale isn't suited to store a coefficient, FDCT2 stores the square root of the coefficient
- IDCT2 is the opposite of FDCT2
This video (Lagarith - 808 kB) contains the following frames :
- analysed frame (resulting RGB picture - 538 kB) : this one is from the modem.
- FDCT2 result (RGB - 309 kB)
- rebuilt frame using IDCT2 (RGB - 660 kB)
I processed the FDCT2 result a little to see better (Y plane at the top, U at the left, V at the right, null coefficient (127) made transparent, brightness/contrast adjusted) : 189 kB.

BTW, the following filter :
LanczosResize(480,576).LanczosResize(768,576)
does almost nothing on my captures.
Quote:
Btw, there's a VDub plugin which shows the spectrum of the video, so that you can see the resolution of it. I will post about it on sunday/monday.


Back to my initial question... The goal is to maximize the quality of my captures. In fact, you already answered :
Quote:
Originally Posted by Wilbert
No, it doesn't. It samples at 35.48 MHz (see 5.2). It always samples at a fixed rate and downsizes to the requested capture size.
Increasing the resolution would always improve the quality, even if it's a little bit.
I should rather downsize after having processed the video.
lcld is offline   Reply With Quote
Old 12th June 2005, 16:10   #12  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
Huh ? For the capture ? That's the only parameter I can act on...
Ok. That depends on your drivers. But, for example, also the used comb filter influences the quality of your capture.

Quote:
AFAIK, there is nothing in an "audio spectrum" that is specific to audio data. It justs performs a FFT. When I load the video in Audacity the way I described, I just get the signal that has been sampled by the capture card, don't I ?
Sorry, i still don't know how to interpret your spectrum (spectre.png). What's on the horizontal axis? What's on the vertical axis? If it is a videospectrum the intensity should run from 0 to 4 MHz (or something like that).

Last edited by Wilbert; 12th June 2005 at 16:14.
Wilbert is offline   Reply With Quote
Old 21st June 2005, 14:53   #13  |  Link
trevlac
budala
 
Join Date: Oct 2003
Location: U.S.
Posts: 545
@lcld

I wrote a vdub filter that shows the spectrum of an image.

Doc Starts here ....
http://www.trevlac.us/FilterDocs/Filters.htm


Go here if you can't figure out my silly web design
http://www.trevlac.us/FilterDocs/FAn...yzer.htm#Intro


Not sure if you are still interested in that. I didn't to the FFT myself, but used the FFTW library.
trevlac is offline   Reply With Quote
Old 23rd June 2005, 02:49   #14  |  Link
lcld
Registered User
 
Join Date: Jan 2005
Location: France
Posts: 28
Quote:
Originally Posted by Wilbert
Ok. That depends on your drivers. But, for example, also the used comb filter influences the quality of your capture.
No comb setting.
There's something called "sharpness" (min:0, max:4, default:3), all my examples in this topic have been done with this setting at 3. For a while, I thought it was just a post-processing filter, an awful edge enhancement filter (horizontal only). I don't know what to think now, and I wonder how it works.
Quote:
Sorry, i still don't know how to interpret your spectrum (spectre.png). What's on the horizontal axis?
The position x on the horizontal axis corresponds to the pixel (X,Y) = (x mod width, floor(x/width)).
Quote:
What's on the vertical axis? If it is a videospectrum the intensity should run from 0 to 4 MHz (or something like that).
Yes.
Quote:
Originally Posted by trevlac
@lcld

I wrote a vdub filter that shows the spectrum of an image.

Doc Starts here ....
http://www.trevlac.us/FilterDocs/Filters.htm


Go here if you can't figure out my silly web design
http://www.trevlac.us/FilterDocs/FAn...yzer.htm#Intro


Not sure if you are still interested in that. I didn't to the FFT myself, but used the FFTW library.
Great plugin (and funny site)
It seems I get the same results as with my avisynth plugin.
For the example of my previous post, I get this : luma channel - dB/0 (322 kB)
lcld is offline   Reply With Quote
Old 23rd June 2005, 17:52   #15  |  Link
trevlac
budala
 
Join Date: Oct 2003
Location: U.S.
Posts: 545
Well ... it looks to me you are getting 3MHz at best on the horizontal. The vertical goes out to the max (and more) because of the interlaced fields and the edges on all the boxes. The side edges on the boxes should have high frequencies for the horizontal. But they are blurred.

Is it due to the 5x5 channel view? I assume this is comming from the cable providor, and not something your card/software does.

I guess it looks much better on the TV ... or else you would not be looking into this.

--------------------------
Bottom line ....

When a signal goes into the ADC of a capture device, it is sampled at a relatively high rate (35MHz for PAL on a CX chip or over 2200 pixels Horz). These samples are then down sized to your final output number of samples/pixels. The down sizing is a resample opperation that includes digital filtering effects. These ADC chips have quite a few options. Like increasing the sharpness or various lowpass filters. You no doubt have a lowpass filter going on in the process. If it is the chip/card, the driver is the guy setting the filter.

As you have covered a bit, the conversion from composite to luma/chroma can also have a lowpass filter effect. I believe this too is done in the chip.

So have you thought about trying a different driver?

BTW:
http://www.trevlac.us/docs/cx2888x.zip

That is the specs on the chip that give gorry details.
trevlac is offline   Reply With Quote
Old 23rd June 2005, 19:45   #16  |  Link
lcld
Registered User
 
Join Date: Jan 2005
Location: France
Posts: 28
Quote:
Originally Posted by trevlac
Is it due to the 5x5 channel view?
I don't see why, even if this channel is certainly compressed a lot. Why would such a channel be horizonally blurred, and not vertically.
Quote:
I assume this is comming from the cable providor, and not something your card/software does.
Maybe.
Quote:
I guess it looks much better on the TV ... or else you would not be looking into this.
No, it was rather a XviD question (cf the initial post). Increasing the quality would be great of course.
Quote:
So have you thought about trying a different driver?
For example ??? Apart from the linux one, I don't see.
Quote:
BTW:
http://www.trevlac.us/docs/cx2888x.zip

That is the specs on the chip that give gorry details.
( http://www.trevlac.us/docs/cx2388x.zip )
Surprising. Found many settings like brightness, contrast, coring, but nothing about sharpness.
lcld is offline   Reply With Quote
Old 23rd June 2005, 20:36   #17  |  Link
trevlac
budala
 
Join Date: Oct 2003
Location: U.S.
Posts: 545
I was not too clear before. Is the image better on a TV? No capture device. If so ... it's the device.

Here is a filter I would be concerned about. It's from that pdf.

Figure 2-53. Combined Luma Notch 2x Oversampling and Optional Low-Pass Filter Response for PAL/SECAM



I'm sure you can use a driver for other manufactuer cards that have the CX chip. The tuner may not work. Use a VCR as a tuner ....


Just some other ideas
trevlac is offline   Reply With Quote
Old 23rd June 2005, 20:40   #18  |  Link
trevlac
budala
 
Join Date: Oct 2003
Location: U.S.
Posts: 545
Quote:
Originally Posted by lcld
I don't see why, even if this channel is certainly compressed a lot. Why would such a channel be horizonally blurred, and not vertically.
You don't gain much by reducing the analog bandwidth in the vertical direction. That would require less scan lines. If you reduce in the horz direction, you could fit more channels.
trevlac is offline   Reply With Quote
Old 4th September 2005, 15:58   #19  |  Link
niiyan
Registered User
 
Join Date: Sep 2002
Posts: 88
@lcld
I tried your DCT plugin, but it doesn't work.

My script is like this:
Code:
LoadPlugin("C:\PluginsDir\DCT.dll") # or plugin auto-loading.
AviSource("foo.avi") # Huffyuv, YUY2 , 640 x480.
FDCT() # or other filter.
return last
I also tried different sizes by adding LanczosResize(720,480) or LanczosResize(768,576) before DCT.
But when I opened this avs, VirtualDubMod freezed (no response).

So, what is the problem?
Or are there any requirements for using this plugin.

My environment:
AviSynth: v2.5.5 / 2.5.6 beta4
VirtualDubMod: v1.5.4.2 / 1.5.10.2
OS: Windows XP (SP2)
CPU: Athlon Thunderbird 1.3G
niiyan is offline   Reply With Quote
Old 4th September 2005, 16:08   #20  |  Link
lcld
Registered User
 
Join Date: Jan 2005
Location: France
Posts: 28
Quote:
Originally Posted by niiyan
But when I opened this avs, VirtualDubMod freezed (no response).
No, it is just computing.
Imagine a naive and plain-C implementation of a big DCT... I wrote in my post : "No need to say this is insanely long to compute "
I wouldn't be surprised if you must wait one hour for one frame on your computer.

This plugin has been written only to help answering to this topic.

Last edited by lcld; 4th September 2005 at 16:31.
lcld is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:06.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.