Quantcast Recording Video: a Little Guide for Better Capturing - digitalFAQ.com Forums [Archives]
  #1  
03-02-2004, 09:22 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Hi, this is a Guide how we can get out the best of captures and their post processing using known apps. and routines.

First, all depends of the capture card & capture quality to archive good KVCD/KDVD Capture encodings.

I tried a lot of cards and I ended up using a 7134 philips chip based one.


1. The Capture Signal quality

Most tuners on Tv capture cards do not give that excellent quality, even if you use a good capture codec set to highest quality, sometimes captures do come out including some artefacts and pieces of horizontal lines. Also some channels can't be received in a good enough quality, even a VCR connected to the same antenna signal will give a good output.
And thats the point: The tuner! IF you got the possibility to use an external (s)VHS VCR as tuner device ... try it! In most cases you will see a quality difference.

In some cases even if a good tuner device won't give a good signal, you can try to use an antenna-signal-amplifier.

amplifier.jpg

Also there do exist hardware filter interfaces to filter out "interferences" from the incoming signal. In German its called "Mantelstrom-Filter".

mantelstromfilter.jpg


2. The Connection

If you use an external device as provider of the signal (DV cam, VCR as Tuner device, VCR to capture VHS Tapes, etc.), you should take care of the connection. Try to avoid using the FBAS connection! Means the single yellow cinch connection, cause that connection does provide the luma and chroma channel mixed up in ONE channel. Better is to use a separate luma/chroma connection (Y/C) means a s-video connection. Here both, the luma and chroma signal are provided separately which does end up in a better capture. Only use high quality cables/connectors.

fbassvideo.jpg

In the pic above you see upper left the yellow FBAS (worse) connector and below the (better) Y/C s-Video connector.


3. The Capture Codec

Well the most importand thing in case of choosing a capture codec is its encoding speed AND its used colorspace!
Most capture cards do provide a YUY2 signal to the codec (can be choosen in the capt. appl.) and by this the best would be to use a YUY2 codec for encoding during capturing.

Why?
a) you safe at least one color-conversation
b) in case of YUY2 you deal with a 4:2:2 format! Means a better chroma subsampling.
c) YUY2 is better in case of capturing interlaced incoming signals!

The chroma subsampling is VERY tricky and affects very much the capture result. Because we everytime should set in the codec "interlaced" encoding. Thats cause you never know what will be broadcasted.
In case of NTSC you could receive a real interlaced signal and of course a telecined movie signal. Both do need to be encoded as "Fieldbased" means in NTSC 60fps interleaved to 29.97 and in case of PAL 50fps interleaved to 25fps. Be aware the in PAL beside real interlaced broadcastings there do exist movie broadcastings in progressive (PAL speedup) AND interlaced! (telecined PAL means phase shifted or conversations from 29.97 ntsc telecined sources directly to 25.000 pal incl. blending etc.) so thats why we do encode interlaced means fieldbased, in ntsc land generally ind in pal land just to be safe.

Whats the codec's colorspace:

- mpeg2 and mpeg4(dvix,xvid) encoders do in general encode in YV12 means 4:2:0 - caution in case of fieldbased capturing!
- mjpg encodings will be most done in YUY2 - 4:2:2
- HuffYUV does encode in YUY2 - 4:2:2

The common codecs:

YUY2:
PicVideo mjpg, Morgan mjpg, HuffYUV

YV12:
Xvid, divx, mpeg2, ms mpeg4 ... and all other mpeg based codecs

So why should I avoid using a YV12 4:2:0 codec in case of INTERLACED capturing?

Because 4:2:0 does subsample the chroma in a different way then 4:2:2
Here you can see a very good explanation: http://www.mir.com/DMG/chroma.html
YV12 4:2:0 = "Chroma is sampled at half the horizontal frequency as luma, and also at half the vertical frequency."
YUY2 4:2:2 = "Chroma is sampled at half the horizontal frequency as luma, but the vertical frequency is the same."

Here you see an example (300% upscaled) of an INTERLACED! YV12 codec capture 4:2:0

Chroma2.jpg

Above you can see the result of that half chroma vertical frequency and how it results in an interlaced capture.

Q: "But Xvid does decode Interlaced 4:2:0 correctly???"
Yep, but the system doesn't know how to interprete the YV12 4:2:0 correctly (Sharfis_Brain explained me that and I hope I did understand that well)

But anyway now you got one of these 4:2:0 captures, how do you can get rid of these chroma artifacts? The solution is avisynth and a colorspace conversion so the chroma will be interpolated.

just apply in the avisynth script.... converttoYUY2(interlaced=true) and the artifacts will be gone:

Chroma1.jpg

Ok, the artifacts are gone, but you still will recognise "bleeding" on edges to especially red contents in the video. Because the chroma is just interpolated!

These YV12 4:2:0 issues do only belong to INTERLACED YV12 4:2:0 capturing/encoding.

Conclusion:
The best would be to use one of the YUY2 based capture codecs as mentioned above. I personally prefer the picVideo mjpg codec, as its fast and not that expensive. I recommend to use a quality of 19 in picVideo.

And if you still want to use a Xvid or Divx 4:2:0 codec (if you don't have that enough disk space for example) use the interpolation way as shown in the avisynth command above.

4. The Resolution

Capture at full height! Means in NTSC 480 and in PAL 576. Why? Because by using full height you can capture interlaced (as recommended above) cause of maintaining the field based line architecture.

So you can decide if you just want to capture in 640x480, 704x480, 768x576, 704x576. If your machines power does not allow to encode using those high resolutions without dropping frames while capturing you can switch to less width: 352x480 ntsc or 352x576 pal.

I do not recommend to capture in 352x240/352x288 because in the other case as above in full height resolutions, afterwards you are free to decide to encode at 1/2 DVD resolution or to deinterlace or if you want to deinterlace and downscale to 352x240/288.


5. The Capturing apps.

Most cards do come with a wdm based card driver, so you can use wdm based capture apps. like VirtualVCR or iuVCR. VirtualVCR comes with am audio dynamical resampling unit which lets you end up with perfect nedded framerate synced streams.
VirtualDub is a very nice capture appl. BUT it needs vfw drivers!
So if you got only a wdm driver you can try using a wdmvfw wrapper which lets Virtualdub recognise your wdm driver based card.

A very good guide for capturing in geneal and also when using VirtualDub or Virtual VCR:
http://www.doom9.org/index.html?/capture/start.html


6. The post processing

Now you got your capture on your HD, so what next?
First we have to find out which areas have to be cropped. And that we can easely do with Vdub.

Load the capture into vdub and choose "Filters" upper middle. Add the filter "Null Transform" and after this below right choose "Cropping".

cropping.jpg

As you see above I did crop the trashy sides and shurely the black bars on top and bottom. Please everytime choose values devidable by 2 especially on top and bottom.
Note the "X1 offset" and the "Y1 offset" values as we need them later in FitCD. After this hit "OK".

sizevalues.gif

Above you see the cropped resolution of 696x432 ... also note that as we need that later in FitCD too. Now you can leave VirtualDub.


Now we do open FitCD:

fitcd.gif

Here you enter in a) the cropped resolution and b) the X1 value for the left border and the Y1 value for the top border ... as you noted these values when cropping in Virtualdubs "Nulltransform". Choose in case of VCD resolution an overscan of 1 and in case of SVCD/DVD/XVCD resolution an overscan of 2 (maximal 3 if your TV permits)
After this choose "Save Script".

Now you got a perfect importing Avisynth script.
(below I deleted the not needed deactivated "#" lines)
Code:
AviSource("H:\capture.avi")
BicubicResize(448,432,0,0.6,16,72,672,432)
AddBorders(16,64,16,80)
Now you can add filters and routines.

In case of an interlaced NTSC 29.97 movie capture you first have to apply an IVTC routine which restores the stream to its orig 23.976 progressive state.
Code:
AviSource("H:\capture.avi")
BicubicResize(448,432,0,0.6,16,72,672,432)
Telecide()
Decimate()
AddBorders(16,64,16,80)
Telecide, Decimate are part of the decomb-package to be found at:
http://www.avisynth.org/warpenterprises/


If you got a progressive PAL capture no IVTC via telecide or deinterlacers must be added. But if you got an interlaced PAL capture you should know how that stream has been shot originally.
So if its a hollywoodmovie which is shot on film, in PAL most times a pal speedup to 25fps from original 23.976 fps NTSC Film is used and pal country-audio added. That would end up in a progresive capture.
But as said, IF you see interlacing even on a hollywood movie capture in pal, there are two possibilities how this movie could have ben treated:

a) A PAL phase-shift has been applied, means does look interlaced but it ISN'T really interlaced. We can just try on that PAL capture a Telecide(Guide=2,Post=False) without decimate()!
Is the interlacing gone? Yes? ok in these most cases of interlaced pal hollywood movie captures you have luck.

b) But if that Telecide inverse phase shift routine does not help, you got a bad pal directly converted from a telecined ntsc 29.97 movie ("startrek next gen.", "Baywatch" for example) which only can be encoded as interlaced, or performing a full deinterlacer or on the other hand treated by complex frame routines in avisynth. In such a case do look in doom9.org for restore24.avs, its very fresh but could help.

IF you captured a documentation, some music videos, TV station trailers etc. ... means streams which have been originally shot on Video Material, you have to deinterlace.

In case of "real" interlaced PAL capture sources (not just field-shifted) we can use:

- Fielddeinterlace(full=false, blend=true) # also try blend=false

- Smoothdeinterlace(doublerate=true,TFF=true, blend=true).selectodd() # also in here try blend=false

Fielddeinterlace is part of the Decomb-Package as mentioned above.
Smoothdeinterlace can also be found in the warpenterprises link as posted above.

In NTSC we also can use these deinterlacers on real 29.976 interlaced captured sources but we also should do a trick which does convert that - now deinterlaced and therefore now progressive but still 29.97 fps stream into a nice compressable 23.976 fps one
See this link where you can find Sharfis_Brain's 60ito24p function for avisynth which exactly does that:
http://www.kvcd.net/forum/viewtopic.php?t=8678
In that Link you also find my comparision between blend = true or false in the case of the mentioned deinterlacers above.

In PAL we can do encode a deinterlaced or progressive stream easely at 25fps as known.
But in NTSC if we want to encode a 23.976 stream, we have to add a pulldownflag to the stream while encoding:
www.incredible.de.tf/pulldown.html

BTW: The best "interlacing/de-interlacing" guide I know is the new page done by Sharfis_Brain from doom9.de/Gleitz.de:
http://home.arcor.de/scharfis_brain/...esInterlacing/
Its in german, but you easely can use your prefered online translation engine like in google.


7. Video quality optical enhancement

Well as you see above you end up with a nice avisynth "base" script out of FitCD.

In most cases now the Capture does NOT got the right luma scaling, means dark parts are too light and light parts are too dark.

Avisynth gots a nice command to correct that: Levels()

But how to configure Levels()??? Very easy!:
First edit the last state of the avisynth script that the addborders(..) command will be deactivated! Like this...
Code:
AviSource("H:\capture.avi")
BicubicResize(448,432,0,0.6,16,72,672,432)
#AddBorders(16,64,16,80)
Open that script without the borders in Virtualdub and choose again "Filters", here you add the Filter "Levels" ... and choose "Show Preview"

levels1.jpg
levels2.jpg

Above you can see the bars which affect the luma.
Now, do scroll in the right preview to a frame which contains the most black part of the stream and hit "sample Frame". Move the upper left slider a) to the right until it touches the left end of the histogram.
After this, choose a very bright containing frame of the stream, hit again "Sample Frame" and move the upper right slider b) to the left until it touches the right end of the histogram. Do note the values as shown in c)!
(Note that the histogram above in the sample picture I posted here is used for checking the bright scene! The step where I choosed the dark frame I did before. You cant determine both - dark and white content - on one sample frame! As you see above in only that sample, only bright histogram values do appear).
Now close Vdub, reopen the avs script, remove the "#" in front of the addborders(...) line and put one line before addborders(...) the Levels() command including the Values noted out of the Levels Filtersettings from Vdub we did before.
Code:
AviSource("H:\capture.avi")
BicubicResize(448,432,0,0.6,16,72,672,432)
Levels( 9, 1.0, 239, 0, 255)
AddBorders(16,64,16,80)
You see I just typed in Levels() the values in the following order they did appear in the Levels adjust window in Vdub. Thats it.

ready.jpg


Also you can add some filters an routines which do enhance more the optical quality of the video using avisynth and for example denoisers.

But as this is a capture guide and not an avisynth guide, I want you to look out in this forum for threads where especially captures have been treated. In many cases DialHots optimal scripts do a very well job on noisy progressive! captures.

Have fun!

Inc.


---------------------------------- Revision History -------------------------------

03/03/2004

- Added the link to Sharfis_Brain's "interlacing/deinterlacing" Guide-Site. http://home.arcor.de/scharfis_brain/...esInterlacing/
Can be translated using online translation engines. IMHO its a very good and fresh guide where everything about Fieldbased conversions and techniques is explained professionally and understandable.
- Links to needed avisynth .dll's added.


Attached Images
File Type: jpg levels.jpg (46.7 KB, 0 views)
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
03-02-2004, 09:43 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
E.X.C.E.L.L.E.N.T. guide Inc

-kwag
Reply With Quote
  #3  
03-02-2004, 10:58 PM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
E.X.C.E.L.L.E.N.T. guide Inc

-kwag
really, i can't find better words

very

inc, this guide is saved in my hd !
Reply With Quote
  #4  
03-03-2004, 01:57 AM
Peter1234 Peter1234 is offline
Free Member
 
Join Date: Feb 2003
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
Very nice guide. Where can I get the "Levels" filter?
Reply With Quote
  #5  
03-03-2004, 09:30 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Levels() is a native Avisynth command and it also should be ready integrated in the newest Vdub versions.

Just in case the levels() explanation of avisynth:
http://www.avisynth.org/index.php?page=Levels

Virtualdub Plugins:
http://neuron2.net/mine.html
Reply With Quote
  #6  
03-03-2004, 10:39 AM
Peter1234 Peter1234 is offline
Free Member
 
Join Date: Feb 2003
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
incredible,
Thanks. I found out what I was doing wrong. I downloaded Virtualdub 1.5.10.0, and when I go to the Video menu and open filters there are no filters there (empty box) so I thought they were missing. To get them to show up I need to click on the ADD button. Thought I would mention that in case anyone else has same problem.
Reply With Quote
  #7  
03-03-2004, 11:14 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Quote:
Originally Posted by incredible
.... here you add the Filter "Levels"
I think its mentioned there
Reply With Quote
  #8  
03-04-2004, 07:30 PM
vmesquita vmesquita is offline
Invalid Email / Banned / Spammer
 
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
Great guide, congratulations incredible. I wish I knew about the levels thing before.
Reply With Quote
  #9  
03-12-2004, 06:50 PM
Razorblade2000 Razorblade2000 is offline
Free Member
 
Join Date: Aug 2002
Posts: 323
Thanks: 0
Thanked 0 Times in 0 Posts
Woooooow... dude, wonderful!

I guess I'll start capturing again...
Echt gute Arbeit.
Reply With Quote
  #10  
03-23-2004, 10:28 AM
Peder Peder is offline
Free Member
 
Join Date: Feb 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
I've been using VirtualVCR to capture TV through my Geforce MX460 and I've noticed a strange thing:
When I use 360x270 I don't get an interlaced avi (Great!).
I'd like to achieve the same at a slightly larger resolution, around 450x... . Is that possible and does anybody know why this happens?

The source is PAL.

Peder
Reply With Quote
  #11  
03-23-2004, 03:48 PM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible


Shure, when capturing at 360x270 you wont get an interlaced sreams as you don't capture at full height! Means: Not Fieldbased and therefore you never know before if you get a NTSC/PAL Conversion, which would resuld in blended frames even if capturing at that low resolution.

Now to the resolution:
360x270 or around 450 at PAL (and also NTSC) ..... these are NO legal capture resolutions where you can encode them easely to kvcd specs without extremly quality loss!

Legal res. in PAL:

352x288 = VCD Res. 100% Progressive but less quality and dangerous as not fieldbased (expl. above)

352x576 = Half D1 100% Fieldbased which can ideal be deinterlaced or even better if the source allows it it can be inverse fieldshifted, that will keep an extreme amount of quality. BEST Choice in case of low CPU power!

704x576 = Full PAL and correct aspect ratio on quadra pixel based capturing maintained, ... ends up in best capturing quality.

720x576 =full D1, we DON't USE THAT res. in case of capturing as this will result in an incorr. spect Ratio!

768x576 =Full PAL square pixels, if resized afterwards to 704x576 the aspect ratio will be ok.


So do read my guide above carefully and you will understand such words like "inverse field shift" etc.
Reply With Quote
  #12  
08-23-2006, 08:23 PM
nicksteel nicksteel is offline
Free Member
 
Join Date: Nov 2002
Posts: 863
Thanks: 0
Thanked 0 Times in 0 Posts
Has anyone experimented with the settings on the PVR-150? I use WinTV2000.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Recording Video: Best capturing software? bigggt Video Capturing / Recording 0 03-17-2006 07:35 PM
Recording Video: DScaler and capturing andybno1 Video Capturing / Recording 4 04-28-2003 11:09 AM
Recording Video: Advice on capturing conquest10 Video Capturing / Recording 4 04-13-2003 06:26 PM
Recording Video: Green in capturing andybno1 Video Capturing / Recording 10 04-06-2003 12:06 PM
which vcr to buy for recording/capturing video? rendalunit Video Capturing / Recording 3 09-10-2002 02:51 PM

Thread Tools



 
All times are GMT -5. The time now is 09:36 AM  —  vBulletin © Jelsoft Enterprises Ltd