Avisynth: MA script for interlaced sources?
Code:
nf=0 Spatial filters affect the video more because SeparateFields() splits each frame into two fields, so 720x576 becomes 720x288. That's why I've lowered the STMedianFilter values, MergeLuma may also appear to be too strong. You may want to try replacing STMedianFilter with FluxSmooth. Just don't do any temporal filtering at that point (use FluxSmooth(-1,4) for example)! DCTFilter can introduce some artifacts near the top and bottom of the video. This can be avoided by cropping slightly. It's probably due to the filters nature, unfortunately I can't give you any better explanations. This is only a small sample based on Kwag's optimal script. Feel free to bash it around :twisted: |
Some remarks:
SwitchThreshold may need tweaking. Kwag? |
Quote:
Maybe make SwitchThreshold a manual constant, until you get the desired switching value :?: Just include: ScriptClip("Subtitle(String(nf),1,30)") after your limiter function call. Then you can see the dynamic value of nf as you play your .avs in Vdub or any player, and this way, you can see the activity level and tune the SwithTreshold selection line depending on activity/resolution. -kwag |
Thanks! I've often wondered how I would see the 'nf' value at each frame..never really got around to check how Subtitle works.
I'm going to capture a TV series tonight and see what I can come up with. |
Boulder,
Do post your results. I do a lot of MPEG2 captures and would like to try doing interlaced. |
A _very_ quick test on a 720x576 VHS capture shows that the value is around 2.5 - 4.0 when there's little motion and 6.0 - 12.0 when there's motion (not intense but some).
How would I start tweaking the threshold? *:lol: feeling like a total newbie :lol:* |
Quote:
Or you can expand the line: "SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2" to include more resolutions :idea: :D -kwag |
@Boulder
How/where do you get the correct values for Crop and BicubicResize? I'm guessing you're using MovieStacker, but could you please explain where you find the values? :oops: EDIT: Never mind the BicubicResize question, but I'm still having trouble with getting Crop to work... |
Thanx 4 the script Boulder looks good. :)
|
I simply put my Crop values from MovieStacker's Crop boxes in the script, like this: Crop(668, 428)
But I'm getting an 'invalid arguments to function "Crop"' error in Vdub. How does this line have to look to be correct :?: |
Quote:
You'll have to state how many pixels you crop. I crop manually, using VirtualDub for help. I've never used any program to get the correct values as I trust my own eyes more. So, the syntax is Crop(crop_width,crop_height,destination_width,dest ination_height). Crop(10,24,700,528) would mean that you would crop 10 pixels off the left and right side and 24 pixels off the top and bottom of the clip. The source would be 720x576 in this case (720 - 10 - 10 = 700 and 576 - 24 - 24 = 528). If you want to crop a different amount of pixels from the sides, you can use Crop(left,top,-right,-bottom). From the Avisynth docs: In order to preserve the data structure of the different colorspaces, the following mods should be used. You will not get an error message if they are not obeyed, but it may create strange artifacts. In RGB: width no restriction height no restriction if video is progressive height mod-2 if video is interlaced In YUY2: width mod-2 height no restriction if video is progressive height mod-2 if video is interlaced In YV12: width mod-2 height mod-2 if video is progressive height mod-4 if video is interlaced |
Or you can use the avisynth plugin Autocrop that will give you this information visually, on the image.
|
Boulder.................
When you get your interlaced script tweaked, could you post it? I'm capturing with a PVR-250 at 720x480.
NickSteel |
Sure thing. I'm currently testing the script with the capture, checking some low-motion scenes and extremely high motion scenes and see how the MA script compares to a script I normally use.
|
OK, here are some results:
With the MA script Code:
nf=0 High motion 32 993 620 bytes With a static script Code:
SeparateFields() High motion 35 406 512 bytes Encoding is surprisingly slightly faster with the MA script. The result is a bit blurrier but I'm not sure if it's noticable when watched on a TV. The low motion scene was a bit larger with the MA script, but if I had used TemporalCleaner instead of TemporalSoften, I'm sure that the filesize would have been lower than with the static script. I'm now encoding the whole clip and see how it looks. |
Boulder,
Quote:
I plan to use DVD2AVI to make d2v and create trim statements with VDUB. I will not create AVI files, but go MPEG2 to MPEG2. Should I use the first script EXACTLY as listed above (with d2v instead of avi), or would you recommend something else? |
ooooooohhhhhhhhhhh I am SOOOO confused about the cropping and resizing and addbording bit! I don't think I can handle the "use my eyes" idea because I just don't understand how to change the parameters correctly. If I use Boulder's bicubicresize paraemters and tweak it slightly to be for 704x480 (as opposed to 704x576), it looks like his addborder line is resizing the image too much (i.e. I can see some black bars on the sides).
Is there not an easy way to do this? I rely on Moviestacker so much!!! :oops: I also give AutoCrop a try, which found out that my source has some black bars on the sides. So it recommends a cropping of Crop(8,0,708,480). This just throws everything off for me, so now I have completely NO idea what to do for BiCubicResize or AddBorder. Hoping someone out there can help me! |
Okay, just so I don't sound like a complete buffoon. I finally figured out how to use any resize values obtained from Moviestacker and make them work with Boulder's script. Whether you choose Overlap or Resize for "Blocks TV-Overscan", take whatever values for AddBorders() and/or Letterbox() and put them at the end of your script. Choose Bicubic precise as your resize method, but you'll have to make some modifications to the figures given. In my example, I have a 740x480 source that I'm encoding at 704x480. So according to Moviestacker, I get:
Code:
BicubicResize(704, 352, 0, 0.6, 0, 0, 720, 480) Code:
BicubicResize(704, 176, 0, 0.6) Code:
BicubicResize(672, 168, 0, 0.6) |
When I use MovieStacker v2.0.0 (beta3) for a PVR250 capture of Futurama at 720x480 to produce a KSVCD at 480x480:
MPEG Resizing Source 720x480 DVD Pal(Unchecked) Anamorphic(Unchecked) ITU=R BT.601-4(Checked) Film pixel 720x480 0 left border 0 top border Crop 720x480 accurate Use GripFit(crop/resize)(Unchecked) Resize 336x446 Destination 480x480 SVCD Anamorphic(Checked) Format conversion(Unchecked) Blocks TV-Overscan 2 Resize AviSynth Script Bicubic precise LoadPlugin("C:\video\moviestacker\Filters\MPEG2Dec .dll") Mpeg2Source("H:\fut16\fut16.d2v") BicubicResize(336, 446, 0, 0.6, 0, 1, 720, 478) AddBorders(72, 17, 72, 17) If I half 446 to 223, will not run. BicubicResize(336, 223, 0, 0.6) What should BicubicResize line look like for this? My capture is already YV12. Should I change script in any way? |
Are you using AviSynth 2.5x? I think Boulder's script requires it.
|
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.