digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Capturing / Recording (http://www.digitalfaq.com/archives/capture/)
-   -   Recording Video: A little Guide for better capturing (http://www.digitalfaq.com/archives/capture/8445-recording-video-little.html)

incredible 03-02-2004 09:22 PM

A little Guide for better capturing
 
12 Attachment(s)
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.

Attachment 20

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

Attachment 21


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.

Attachment 22

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

Attachment 23

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:

Attachment 24

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".

Attachment 27

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".

Attachment 28

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:

Attachment 29

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"

Attachment 25
Attachment 26

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.

Attachment 31


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.

kwag 03-02-2004 09:43 PM

E.X.C.E.L.L.E.N.T. guide Inc :D

-kwag

jorel 03-02-2004 10:58 PM

Quote:

Originally Posted by kwag
E.X.C.E.L.L.E.N.T. guide Inc :D

-kwag

really, i can't find better words :!:

very 8)

inc, this guide is saved in my hd !
:wink:

Peter1234 03-03-2004 01:57 AM

Very nice guide. Where can I get the "Levels" filter?

incredible 03-03-2004 09:30 AM

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

Peter1234 03-03-2004 10:39 AM

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.

incredible 03-03-2004 11:14 AM

Quote:

Originally Posted by incredible
.... here you add the Filter "Levels"

I think its mentioned there :wink:

vmesquita 03-04-2004 07:30 PM

Great guide, congratulations incredible. I wish I knew about the levels thing before. :D

Razorblade2000 03-12-2004 06:50 PM

Woooooow... dude, wonderful!

I guess I'll start capturing again... :lol:
Echt gute Arbeit.

Peder 03-23-2004 10:28 AM

VirtualVCR capturing 360x270 w/o interlace
 
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

incredible 03-23-2004 03:48 PM

8O

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.

nicksteel 08-23-2006 08:23 PM

PVR-150 Settings
 
Has anyone experimented with the settings on the PVR-150? I use WinTV2000. :?:


All times are GMT -5. The time now is 03:37 PM  —  vBulletin Jelsoft Enterprises Ltd

Site design, images and content © 2002-2019 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2019 Jelsoft Enterprises Ltd.