Log in

View Full Version : Filters


nicco
11th November 2003, 15:11
I have a DV-2 movie and I want to convert it to Dvix, I want to apply it some filters: resize, deinterlace, blur, and maybe other (color correction...). Is it better to apply them with VDub or with Avisynth? What's the difference?
Another question: what is the colorspace of my DV-movie? Do I have to convert it, for example in YV12?
Thanks a lot for the help

bb
11th November 2003, 18:06
AviSynth is faster than VirtualDub, because it can work with YUV2 or YV12 colorspaces (less data to process than RGB). VirtualDub supports RGB only.

DV uses YUV2 colorspace, so I'd stay in this colorspace. In AviSynth you can convert colorspaces (e.g. ConvertYUY2()), but you should do that only if you want to use a filter that needs a certain colorspace or if your source colorspace is different from your target colorspace (e.g. feeding DVD sources into CCE).

If you downconvert DV's YUV2 colorspace to YV12 and all your filters support YV12, you may win a little performance.

bb

nicco
11th November 2003, 19:30
There's something I don't understand: you say: "DV uses YUV2 colorspace, so I'd stay in this colorspace".
When I apply the deinterlace filter with AviSynth
--------------script:
AVISource("D:\myfile.AVI")
LoadPlugin("c:\Programmi\AviSynth 2.5\plugins\Decomb.dll")
AVISource("myfile.AVI")
FieldDeinterlace()
LanczosResize(720,404)
Blur(0.8)
--------------------------
and I open the *.avs file with Vdub I get this error: "Avisynth open failure - FieldDeinterlace: YV12 or YUY2 data only", Why??

If I change the script:
DirectShowSource("D:\myfile.AVI")
LoadPlugin("c:\Programmi\AviSynth 2.5\plugins\Decomb.dll")
DirectShowSource("myfile.AVI")
FieldDeinterlace()
LanczosResize(720,404)
Blur(0.8)
---------------------
Vdub open the *.avs file (obviously without audio).
I've done a test:I've encoded my movie with this last script and without avisynth (Vdub filters only)and I get the same time!

nicco
11th November 2003, 19:49
Sorry, I'm a very newbie and I had not noticed that you wrote YUV2 and not YUY2... so how can I deinterlace DV with Avisynth in YUV2? Thanks

bb
11th November 2003, 21:11
nicco,

the native DV stream contains data in YUV2 colospace (which is the same as YUY2, although there are marginal semantic differences). The error you get indicates that your DV codec decompresses to RGB only (probably Panasonic DV codec). You can either install a YUV2 capable codec like MainConcept or Canopus, or you can add a "ConvertToYUY2()" command after the "AviSource"/"DirectShowSource" command. In the latter case you'll lose the speed advantage, though.

In your script you open the video twice, and I have no idea why you do that. A single "AviSource" or "DirectShowSource" command should be enough.

Hope this gets you a few steps further.

bb

nicco
12th November 2003, 11:28
Ok, I downloaded CanopusDV codec (V1.00), changed the FourCC of Dv-2.avi file (myfile.avi) in 'cdvc',wrote this AviSynth script:
--------------
AVISource("D:\myfile.AVI")
FixBrokenChromaUpsampling
ConvertToYV12(interlaced=true)
LoadPlugin("c:\Programmi\AviSynth 2.5\plugins\Decomb.dll")
FieldDeinterlace()
LanczosResize(720,404)
Blur(0.8)
--------------
opened the *.avs file in Vdub and encoded it in divx (fast recompress), and I get the same time I had using only Vdub (PanasonicDV codec, Vdub filters, full processing mode)
Where is the speed advantage of using Avisynth?

bb
12th November 2003, 17:48
Well, you can't compare it that way. You use more and different filters than in VirtualDub. E.g. there's no "FixBrokenChromaUpsampling" in VirtualDub, "LanczosResize" is a very good, but slow resizer, etc.

Which filters do you use in VirtualDub to achieve the same thing? What do you mean by "I get the same time I had using only Vdub"? Exactly the same encoding time up to the second?

bb

nicco
12th November 2003, 18:07
Settings when I use ONLY Vdub:
(PansaonicDV codec - RGB24)
- full processing mode
- filters: deinterlace(mode:blend), resize(720x404-lanczos3), blur

I have the same time in minutes , I dont't know for seconds, I had 77 minutes encoding in both tests

nicco
14th November 2003, 19:04
waiting for an answer...:)

bb
14th November 2003, 22:00
Try
LoadPlugin("c:\Programmi\AviSynth 2.5\plugins\Decomb.dll")
AVISource("D:\myfile.AVI", pixel_type="YUY2")
FieldDeinterlace()
LanczosResize(720,404)
Blur(0.8)

and compare this script to your VirtualDub settings.

bb

nicco
15th November 2003, 16:57
I tried and I get this:

AVS:6 mins
Vdub:6 mins

But, however, apart from speed, becouse avs let me encode the dv file in YUY2, is it even better then using Vdub only?

bb
15th November 2003, 19:29
I wouldn't say that, at least not just because of the colorspace. The upconversion to RGB may be considered lossless. There are probably more and better filters available for AviSynth than there are for VirtualDub nowadays, I guess. So if you don't get a speed advantage, this may be a reason for you to use AviSynth. If I were you I'd try KernelDeint for the deinterlacing. Even FieldDeinterlace should be much better than your simplistic "deinterlace(mode:blend)". For a fair comparison you'd better use SmartDeinterlace on the VirtualDub side, but I don't know if there's a "KernelDeint" version for VirtualDub.

bb