Log in

View Full Version : How do I improve these captures?


iCookie
2nd March 2009, 21:20
I've captured some Simpsons and Seinfeld tonight on my WinFast 2000XP capture card. It's captured in MPEG-2 (optimal quality).

Here's the Simpsons example (http://www.megaupload.com/?d=F907NSHU)
Here's the Seinfeld example (http://www.megaupload.com/?d=QW3KK3RU)

As you can see there is a bit of background noise there.
Basically I need to know what filters etc. I can use to make the image as best as possible?

Thanks in advance

MadRat
3rd March 2009, 06:26
Looking at your Simpsons clip I'd say you have three problems: noise (obviously), dot crawl (look at the clouds as the words "The Simpsons" appear and you'll see lots of little moving dots traveling along the edges) and finally rainbows (look at the church sign and you'll see lots of extra colors in the white on black letters). You'll also want to make sure you have the right colors. This is what I'd do...


ffvideoSource("WinFast Video Capture0302-1855(Viasat 4) (1).mpg") # load the video whatever way is easiest
ColorMatrix(mode="Rec.709->Rec.601") # get the correct colors
ChubbyRain2() # remove the rainbows
fft3dfilter(sigma=4,bt=4,plane=4,sharpen=0.5,bw=32,bh=32,ow=16,oh=16) # remove the noise and add some sharpening
AAA() # remove any remaining dot crawl


You can find ChubbyRain2 here http://forum.doom9.org/showthread.php?p=1223079

fft3dfilter (http://forum.doom9.org/showthread.php?t=85790) is a noise removing and sharpening filter that's pretty slow but highly effective. The sharpening is from 0.0 to 1.0 but the higher you go the more you'll have halos which will show up a lot in a simplistic cartoon like The Simpsons. But where the coloring book artwork of The Simpsons helps you is in the noise removal. You could think of the sigma as the strength of the filtering, the higher the number the more noise is removed and the lower the number the less noise is removed. fft3d is really good at not removing detail unless you put a really high sigma. But The Simpsons doesn't have detail so you could jack it up to like 5 or 6 if you wanted and it might look just fine (I'm not sure I didn't try it). Sigma is a floating point number so you could also use 4.5 or something.

AAA is an anti-aliasing script used for smoothing jagged lines in anime, but strangely enough it's also really good at geting rid of dot crawl. Since I couldn't find the AAA() thread I'll post what I use. There may be much better scripts, I don't honestly know. This is what I used and the dot crawl went away.


# AAA - AnimeAntiAliasing
#
# Thanks @ Didée, mf, Akirasuto, SpikeSpiegel & ScharfisBrain...
#________________________________________________________________________________________
#
# Usage: AAA(Xres, Yres, Xshrp, Yshrp, Us, Ds, chroma)
#________________________________________________________________________________________
#
# Xres/Yres = The final resolution... InputSize = OutputSize is the default
#
# Xshrp/Yshrp = Unfilter strength... Settings of 15,15 are the defaults
#
# Us = Resizer for upsampling... 0 = PointResize (default) / 1 = Lanczos
#
# Ds = Resizer for downsampling... 0 = Bilinear (default) / 1 = Bicubic / 2 = Lanczos
#
# Chroma = Enable/disable chroma antialiasing... Disable = false (default) / enable = true
#________________________________________________________________________________________
#
# Example...
#
# Import("C:\Programme\AviSynth 2.5\plugins\AAA.avs")
#
# AAA(720,576,20,20,1,2,chroma=false)
#________________________________________________________________________________________

function AAA(clip clp, int "Xres", int "Yres", int "Xshrp", int "Yshrp",
\ int "US", int "DS", bool "chroma")
{
clp = clp.isYV12() ? clp : clp.ConvertToYV12()
ox = clp.width
oy = clp.height
Xres = default(Xres, ox)
Yres = default(Yres, oy)
us = default(us, 1)
ds = default(ds, 2)
Xshrp = default(Xshrp, 15)
Yshrp = default(Yshrp, 15)
chroma = default(chroma, false)

us==0 ? clp.PointResize(ox*2,oy*2) : clp.LanczosResize(ox*2,oy*2)

TurnLeft()
SangNom()

TurnRight()
SangNom()

ds==0 ? BilinearResize(Xres,Yres) :
\ ds==1 ? BicubicResize(Xres,Yres) :
\ LanczosResize(Xres,Yres)

Unfilter(Xshrp,Yshrp)

chroma ? MergeChroma(clp.Lanczosresize(Xres,Yres)) : last

}



I was pretty sleepy when I wrote this so if I made any mistakes I'm sure I'll hear about it. :o

iCookie
3rd March 2009, 19:29
Okay thank you :), but how do I use the AAA script and ChubbyRain2 scripts? They are supposed to be saved as .avsi files in the plugin folder of Avisynth, right?

I use VirtualDub 1.8.8 and AviSynth 2.5.8. So I have this script you made:
DirectShowSource("C:\Documents and Settings\XXX\Desktop\WinFast Video Capture0302-1855(Viasat 4).mpg", fps=25)
ColorMatrix(mode="Rec.709->Rec.601") # get the correct colors
ChubbyRain2() # remove the rainbows
fft3dfilter(sigma=4,bt=4,plane=4,sharpen=0.5,bw=32,bh=32,ow=16,oh=16) # remove the noise and add some sharpening
AAA() # remove any remaining dot crawl

I save it as a .avs file and try to open it with VirtualDub. But I get an error saying:
Avisynth open failure: Script error: There is no function named "mt_convolution" (ChubbyRain2.avsi, line 13)

Halp!

poisondeathray
3rd March 2009, 20:43
I think mt_convolution is part of masktools , you probably need to download it and place in the plugins folder

iCookie
4th March 2009, 17:45
Okay I got MaskTools v2 and now it's working, but now I get an error saying something about Bifrost...so I downloaded BiFrost 1.1.

Now I get an error saying YV12 video required...?

Reuf Toc
4th March 2009, 19:01
Weird... Your mpg files should be YV12. I suggest you to not use directshowsource to import your video but DGindex/DGdecode (http://neuron2.net/dgmpgdec/dgmpgdec.html)


If you still want to use directshowsource just add
ConvertToYV12()
between the first and the second line of your script

or change first line to

DirectShowSource("C:\Documents and Settings\XXX\Desktop\WinFast Video Capture0302-1855(Viasat 4).mpg", fps=25, pixel_type="YV12")

iCookie
4th March 2009, 20:07
Thanks, I now added ConvertToYV12() between 1st and 2nd line and it works...This won't decrease quality in any way over using DGindex/DGdecode?

EDIT: Alright, I finally got it working! But it still looks a bit "pixelated":
Clicky (http://img25.imageshack.us/my.php?image=pixelated.png)
If you look at his suit and at the green tree to the right, it has all these little lines and pixels spread all over the texture... Any way to remove these?

Also, one more thing: When capturing for 2 hours straight and afterwards playing the .mpg file in WMP11, the audio seems to get out of sync when I move the timeline towards the end. Is this because the file is large (8GB) and WMP11 just can't handle it, or is it because my capturecard actually screws up the audio?

Reuf Toc
5th March 2009, 20:37
Thanks, I now added ConvertToYV12() between 1st and 2nd line and it works...This won't decrease quality in any way over using DGindex/DGdecode?


Depends of your directshow decoder I suppose, but with AviSynth, it is strongly recommended to use appropriate source filter in adequacy with your video. And for mpeg, use DGindex and DGdecode is "better" than directshowsource.
Look here (http://avisynth.org/mediawiki/Internal_filters#Media_file_filters) and here (http://avisynth.org/mediawiki/External_filters#Source_Filters) for more information about source plugin/filter


EDIT: Alright, I finally got it working! But it still looks a bit "pixelated":
Clicky (http://img25.imageshack.us/my.php?image=pixelated.png)
If you look at his suit and at the green tree to the right, it has all these little lines and pixels spread all over the texture... Any way to remove these?

Is the orange artifact on Carl's face is in your source too ?
The line and pixel you described are called haloing (http://avisynth.org/mediawiki/External_filters#Dehaloing) and blocking (http://avisynth.org/mediawiki/External_filters#Deblocking)


Also, one more thing: When capturing for 2 hours straight and afterwards playing the .mpg file in WMP11, the audio seems to get out of sync when I move the timeline towards the end. Is this because the file is large (8GB) and WMP11 just can't handle it, or is it because my capture card actually screws up the audio?

Have you tried to play it in another media player like VLC or MPC ?

iCookie
5th March 2009, 21:08
Depends of your directshow decoder I suppose, but with AviSynth, it is strongly recommended to use appropriate source filter in adequacy with your video. And for mpeg, use DGindex and DGdecode is "better" than directshowsource.
Look here (http://avisynth.org/mediawiki/Internal_filters#Media_file_filters) and here (http://avisynth.org/mediawiki/External_filters#Source_Filters) for more information about source plugin/filter
Hm, okay then I'll try to use DGindex and DGdecode instead of DirectShowSource.
Is the orange artifact on Carl's face is in your source too ?Nah, they must be caused by some of the filters I'm using as they are not present in the Source video..The line and pixel you described are called haloing (http://avisynth.org/mediawiki/External_filters#Dehaloing) and blocking (http://avisynth.org/mediawiki/External_filters#Deblocking)
Hmm, I'll try to run some dehaloing and deblocking filters after the first series of filters then. Problem is, I'm already decoding at just 2FPS here, so coding an entire episode will take almost 2 hours...With more filters it'll take even longer.

So I was hoping maybe there is some way of optimizing the avisynth script that MadRat originally posted to get rid of the haloing and blocking...?
Have you tried to play it in another media player like VLC or MPC?
Yes, the same thing happens in at least VLC...

burfadel
5th March 2009, 21:11
Are you using the latest Winfast PVR (actually its Winfast PVR2 now).

It supports all the TV cards Leadtek have, including the TV2000XP.

Latest version is 2.0.3.19 which you can download from the leadtek site. The reason why this is important is that although it can't help you now, it may be of benefit for future records.

iCookie
6th March 2009, 20:48
I'm not sure what version I use really...I'll check it later today, but it's probably the old one.
Is there any difference in capture quality between the versions?

Anyways, anybody know of a way to adjust MadRats script to get rid of the blocking and haloing? I'm not really that much into scripting, so it's hard to know which variables to adjust. Help would be much appreaciated :)

iCookie
7th March 2009, 23:13
I also fear it may be that slow because I'm using several old versions of many of the filters...are there any site that actually keeps track of the newest versions of most filters? Does the avisynth.org site do that, or are most old there too?

iCookie
9th March 2009, 20:18
No more opinions on how I can improve MadRats script so I get less haloing and blocking (http://img25.imageshack.us/my.php?image=pixelated.png) in the result?
ffvideoSource("WinFast Video Capture0302-1855(Viasat 4) (1).mpg") # load the video whatever way is easiest
ColorMatrix(mode="Rec.709->Rec.601") # get the correct colors
ChubbyRain2() # remove the rainbows
fft3dfilter(sigma=4,bt=4,plane=4,sharpen=0.5,bw=32,bh=32,ow=16,oh=16) # remove the noise and add some sharpening
AAA() # remove any remaining dot crawl

PS: Here's the original capture (http://www.megaupload.com/?d=F907NSHU) if you need to see it.

MadRat
10th March 2009, 04:41
Sorry iCookie, I must be a complete idiot. When you sharpen video you tend to get halos. It's an optical illusion. When you see a picture with slight halos and one without the one with halos will look sharper and the one without will look fuzzier. But with simplistic Fox network cartoons like The Simpsons or Family Guy, halos look really bad and don't improve the apparent sharpness of the image. In fft3dfilter there is a sharpen option, I have it set to 0.5. Try fft3dfilter(sigma=4,bt=4,plane=4,sharpen=0,bw=32,bh=32,ow=16,oh=16) and see if that helps any.

iCookie
22nd March 2009, 18:10
Yea, I think it helped a bit :) Anyways, here are the results... (http://www.megaupload.com/?d=9QLMQV7R) (XviD Encoder, AS@L5)

Anything else I should do? Please, let me know...

BTW, in VirtualDub, there is an option for either "Full audio/video processing" or "Direct stream copy". Should I set both audio and video to full processing or what? I am using DGindex/DGdecode to import the original .mpeg-file.

One more thing. There seems to be some strange black bar on top of the picture. I will need to crop it. Should I place the cropping command at the very end of the script or at the very beginning?

Thanks in advance.

iCookie
27th March 2009, 11:50
Nobody knows?

Comatose
29th March 2009, 06:13
Full processing lets you use VirtualDub filters. As a result, the video is converted to RGB internally. Fast recompress just passes the video to the encoder (this is what you should use if you are only using Virtualdub to connect Avisynth and the encoder) and Direct stream copy simply takes the input stream and sticks it in the output file (= no [re]compression).

iCookie
29th March 2009, 11:30
Well I am only using AviSynth filters, no VirtualDub filters. But I am using VirtualDub's timeline to remove the commercial breaks...So should I use full processing then?

And since I use DGindex/DGdecode to split the audio and video, then join them via Avisynth, do you think Direct Stream Copy (for audio) would be best? Or Full Processing?

Gavino
29th March 2009, 12:39
Using Direct Stream Copy in VDub when the input is an Avisynth script does not make much sense, since Avisynth delivers uncompressed video and audio - the original input streams read by Avisynth are not visible to VDub.

If not using any VDub filters (only timeline editing), fast recompress would be the most appropriate.

iCookie
29th March 2009, 16:24
Alrighty then, so Fast Recompress for video and full processing mode for audio?

Gavino
29th March 2009, 17:09
Yes, that's right.

Incidentally, re Comatose's point:Full processing lets you use VirtualDub filters. As a result, the video is converted to RGB internally.
This is less of an issue now, as the VirtualDub help file (mine is v1.8.6) states: "In previous versions of VirtualDub, enabling full processing mode would always force a conversion to 32-bit RGB. This is no longer the case — if no video filters are used, this conversion step is omitted and the video is directly converted to the output format."

iCookie
29th March 2009, 17:54
Alright guys, thanks a lot ;) Here is a little clip (22MB) from the result of the filters used (http://www.megaupload.com/?d=9QLMQV7R). Does it look good? Anything else I could do? Please, let me know...

Reuf Toc
29th March 2009, 18:40
This sample is far better than the previous you posted :cool:.
If you are perfectionist you can remove the alpha blended logo in the top right corner (I suggest you to use DeLogo)

iCookie
29th March 2009, 20:16
Alrighty then, so I guess Im all set and ready to start mass-encoding these captures. The logo doesnt bother me so much, so Ill just leave it in I think. Anyways, thanks for all you guys help. You are all a great community, very helpful...Thanks all :D

By the way, I dcnt know if you noticed, but in my first post, there is another clip (http://www.megaupload.com/?d=QW3KK3RU) Id also love to get some help with. This time its Seinfeld, and since its real world instead of cartoon, I guess Id need another filter combination for that? Any input on how to improve it would be much appreaciated. :)

Reuf Toc
30th March 2009, 18:28
For your Seinfeld clip, try to use MVDegrain or one of the MVDegrain based function, it should be able to get rid of the noise present in your capture.
For the weird artefact in the top of the picture, just crop it.

But there is another problem, I can see combing but I don't know how you can deal with. Since it was recompressed, deinterlacers can't be efficient (for what I know at least).

Blue_MiSfit
4th April 2009, 07:20
Must you use Xvid?

x264 is vastly superior in terms of size:quality and speed:quality.

Your seinfield episode is utterly destroyed. It was vertically resampled without being deinterlaced first. This has destroyed the interlacing structure and there is simply no way to fix it.

Also, the levels are WAY off. They extend into the PC range, and hit a brick-wall at 0 - meaning they were totally screwed up somewhere :). This explains the total darkness.

smoothlevels(preset="pc2tv") helps a bit, but it cant recover information that was clipped out originally.

That's a really brutal clip, buddy :) I strongly suggest you play with your capture card more and see if you can't get things to work better. Are you capturing off RF or S-Video/Composite?

ALSO, don't use DirectShowSource for MPEG-2 video unless you really know what you're doing. Especially don't have directshow decode to YUY2, and then convert to YV12 without doing converttoyv12(interlaced=true). DGIndex/DGMPGDec exist for a reason, and it's very good at its job! Why sidestep it?

~MiSfit

iCookie
10th May 2009, 17:06
So I tried installing WinFast PVR2 for my WinFast 2000XP Expert card. Now I get a error saying "Could not find any available BDA device". I looked around in the WinFast folder and there seems to be very many files for DTV but nothing is mentioned about analouge TV.

Is WinFast PVR2 only for Digital Television-cards or what?

iCookie
16th May 2009, 15:36
Anybody know's what's going on? I still get this error...I can't find the CD with my old drivers so now I'm screwed...I also tried Dscaler and I get "no video signal" and a blue screen...wth do I do know?

iCookie
21st May 2009, 22:54
Finally got it to work with WinFast PVR2. But now there's another problem.

The audio seems to pop and click randomly. The popping and clicking will happen with intervals of everything from 1 sec to several minutes.

Here's an example clip (3MB) (http://www.megaupload.com/?d=HZ67KES1) to show you what I mean. Listen expecially at the beginning when the chopper is flying and the guy in it is talking. Lots of anomalies in the sound...

Here's the spesifications of my capture PC:
2,4GHZ Intel Pentium 4
768MB RAM
WinFast TV2000 XP Expert
Creative Sound Blaster Live! 5.1 Digital
ATi Radeon 9800SE