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. |
7th June 2005, 22:01 | #1 | Link |
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. |
8th June 2005, 03:19 | #2 | Link |
Registered User
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. |
8th June 2005, 13:56 | #3 | Link |
Registered User
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... |
9th June 2005, 01:09 | #4 | Link |
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 |
9th June 2005, 14:41 | #5 | Link | |
Registered User
Join Date: Mar 2004
Location: Ireland
Posts: 481
|
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. |
|
9th June 2005, 16:34 | #6 | Link | |||||
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
About native resolution:
Quote:
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:
Quote:
Quote:
Quote:
|
|||||
9th June 2005, 18:10 | #7 | Link | ||
Registered User
Join Date: Jan 2005
Location: France
Posts: 28
|
Quote:
Quote:
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. |
||
9th June 2005, 21:18 | #8 | Link | ||
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Quote:
More info in section 9.3: http://www.doom9.org/index.html?/cap...gue_video.html Quote:
Btw, you used Audicity to make a spectral analysis of a video frame? |
||
9th June 2005, 22:32 | #9 | Link | |||
Registered User
Join Date: Jan 2005
Location: France
Posts: 28
|
Quote:
Quote:
Quote:
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. |
|||
10th June 2005, 11:57 | #10 | Link | |
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:
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. |
|
12th June 2005, 04:30 | #11 | Link | |||||
Registered User
Join Date: Jan 2005
Location: France
Posts: 28
|
Quote:
Quote:
Quote:
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:
Back to my initial question... The goal is to maximize the quality of my captures. In fact, you already answered : Quote:
I should rather downsize after having processed the video. |
|||||
12th June 2005, 16:10 | #12 | Link | ||
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Quote:
Quote:
Last edited by Wilbert; 12th June 2005 at 16:14. |
||
21st June 2005, 14:53 | #13 | Link |
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. |
23rd June 2005, 02:49 | #14 | Link | ||||
Registered User
Join Date: Jan 2005
Location: France
Posts: 28
|
Quote:
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:
Quote:
Quote:
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) |
||||
23rd June 2005, 17:52 | #15 | Link |
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. |
23rd June 2005, 19:45 | #16 | Link | |||||
Registered User
Join Date: Jan 2005
Location: France
Posts: 28
|
Quote:
Quote:
Quote:
Quote:
Quote:
Surprising. Found many settings like brightness, contrast, coring, but nothing about sharpness. |
|||||
23rd June 2005, 20:36 | #17 | Link |
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 |
23rd June 2005, 20:40 | #18 | Link | |
budala
Join Date: Oct 2003
Location: U.S.
Posts: 545
|
Quote:
|
|
4th September 2005, 15:58 | #19 | Link |
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 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 |
4th September 2005, 16:08 | #20 | Link | |
Registered User
Join Date: Jan 2005
Location: France
Posts: 28
|
Quote:
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. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|