digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Motion adaptive filtering now possible? (http://www.digitalfaq.com/archives/avisynth/3594-avisynth-motion-adaptive.html)

kwag 05-29-2003 12:31 PM

Hi ren,

Get your filter updates here :) : http://www.avisynth.org/~warpenterprises/

-kwag

ARnet_tenRA 05-29-2003 12:39 PM

Here is what I have so far: It divides the movie into 16x16 blocks and allows you to perform filtering on each block separately.

Code:

AviSource(" -Your Movie Here- ")

FilterBlocks()

function FilterBlocks( clip clip, int "cwidth", int "cheight", clip "vertclip" ) {
 cwidth = default(cwidth,0)
 cheight = default(cheight,0)
 vertclip = default(vertclip, HorizontalStrip(clip, cwidth, cheight))
 cheight = cheight+16
 cheight < clip.height ? FilterBlocks(clip, cwidth, cheight, StackVertical(vertclip,HorizontalStrip(clip, cwidth, cheight))): vertclip
}

function HorizontalStrip( clip clip, int cwidth, int cheight, clip "hortclip" ) {
 hortclip = default(hortclip, Crop(clip,cwidth,cheight,16,16).filters())
 cwidth = cwidth+16
 cwidth < clip.width ? HorizontalStrip(clip, cwidth, cheight, StackHorizontal(hortclip,Crop(clip,cwidth,cheight,16,16).filters())): hortclip
}

function filters( clip clip ) {
greyscale(clip)
}

You can place whatever filters you want in the filters function.

Again I used greyscale to show that every block is being filtered.

Regards, Tenra

rendalunit 05-29-2003 01:14 PM

thanks kwag,

All the filters load fine now but I'm still getting the "I don't know what SubBlur means" error :roll:

ren

kwag 05-29-2003 01:18 PM

Quote:

Originally Posted by rendalunit
thanks kwag,

All the filters load fine now but I'm still getting the "I don't know what SubBlur means" error :roll:

ren

You're using some stray variables and lines that I had defined for display purpose as sub-titles :!:
Make sure your script looks like this:

Code:

LoadPlugin("C:\Filters25\MPEG2Dec3.dll")
 LoadPlugin("C:\Filters25\STMedianFilter.dll")
 LoadPlugin("C:\Filters25\UnFilter.dll")
 LoadPlugin("C:\Filters25\BlockBuster.dll")
 
 Mpeg2Source("K:\VIDEO_TS\project.d2v")
 
 MaxThreshold=1.58
 
 UnFilter(50, 50)
 BicubicResize(528, 368, 0, 0.6, 16, 0, 688, 480)
 STMedianFilter(8, 32, 0, 0 )
 TemporalSoften(2,7,7,3,2)
 mergechroma(blur(1.50))
 
 ### Dynamic Adaptive Filtering ###
 val=0 # Initialize our motion variable.
 N="noise"
 
 FrameEvaluate("val=YDifferenceFromPrevious()/14.55") # Assign "val" with difference between current frame and last frame.
 ScriptClip("val > MaxThreshold ? MergeLuma(blur(MaxThreshold)) : MergeLuma(blur( val )) ") # Adaptive mergeluma.
 AddBorders(0, 56, 0, 56)
 LetterBox(16, 16, 16, 16)
 Limiter()

And just make the changes to your source line, resize, addborders and letterbox.

-kwag

kwag 05-29-2003 01:33 PM

704x480 Showoff !!!
 
And here's the showoff for the day :mrgreen:
www.kvcd.net/704x480-showoff.mpg ( CQ=68 MIN=300, MAX=2,500 ~6MB 25 seconds :!:, which should be about the right CQ to fit this particular movie on one CD, looking just like this sample 8) )

Enjoy!,
-kwag

rendalunit 05-29-2003 01:38 PM

Quote:

Originally Posted by kwag
You're using some stray variables and lines that I had defined for display purpose as sub-titles

Yep, I finally figured that out :teeth:

now I'm getting strange noise from blockbuster:

http://www.digitalfaq.com/archives/i.../2003/05/1.png

could this be because of the Variance param becoming invalid?

ren

rendalunit 05-29-2003 01:48 PM

Quote:

Originally Posted by kwag
And here's the showoff for the day
www.kvcd.net/704x480-showoff.mpg ( CQ=68 MIN=300, MAX=2,500 ~6MB 25 seconds , which should be about the right CQ to fit this particular movie on one CD, looking just like this sample

Wow!!! :jawdrop: That looks great!!

btw- what movie is that? I'm going to rent it :D

ren

kwag 05-29-2003 01:52 PM

Hi ren,

I didn't protect the variance in the sample script, but that was just for a test, so don't take it seriously :lol:
The proper way would be using calculations to limit the min and max boundaries, before applying the value to variance. Like another conditional operator "?" to bracket the values.
I really see no need for Blockbuster above 528x resolutions :?
And specially now, that I think we can even go up to 704x480, as in the sample I posted :!:
The dynamic value applied to mergeluma function really saves us a huge amount of data, so I think we can now start to use XVCD 704x480(576) resolution with this methods. This can only get better from now on 8)

-kwag

kwag 05-29-2003 01:53 PM

Quote:

Originally Posted by rendalunit

Wow!!! :jawdrop: That looks great!!

btw- what movie is that? I'm going to rent it :D

ren

"The Foreigner" :)

-kwag

bman 05-29-2003 02:31 PM

Quote:

Originally Posted by rendalunit
Quote:

Originally Posted by kwag
You're using some stray variables and lines that I had defined for display purpose as sub-titles

Yep, I finally figured that out :teeth:

now I'm getting strange noise from blockbuster:

http://www.digitalfaq.com/archives/i.../2003/05/1.png

could this be because of the Variance param becoming invalid?

ren

@ ren
To get rid of noise blocks I did some changes in BlockBuster line :
ScriptClip("val < 0.3 ? BlockBuster(method=N, detail_min=10, detail_max=15, variance=(1/val*10), seed=0) : val > 1 ? blur(1.58) : blur(val)")
This values I get by testing (encoding sample) and I'm quite sure that thay
will be different for different sources (dvd's) .
I think best is if u check min - max values for your source and according that adjust tham .
I hope it's helpful
bman

DorvalCS 05-29-2003 02:36 PM

I figured it out :idea: :idea:

I was running into this problem earlier today
<<When I load the script in VirtualDub I get this error message:
"Couldn't locate decompressor for format YV12" >>

I have downloaded and installed the Video Codec "ATI YV12 4:2:0 Planar v.4.12.5038".... No more problem. :oops: I don't know if that's what I was suppused to do... But it fixed my problem :lol:

I'm now in full testing mode for thise new 2.5 Script... Can't wait to see some relusts.. :wink:

bman 05-29-2003 02:45 PM

@ all
Any suggestions for VoBSub or TextSub for Avs2.5
bman

ozjeff99 05-29-2003 08:32 PM

Kwag....704x576 woohoo. Since I can't do KVCDx3 this is very tasty. Great work everyone! :P
ozjeff99

ovg64 05-29-2003 08:52 PM

Finally i took some time and got these thing going with avs2.51, now it would be nice if MovieStacker would generate our avs scripts again. :mrgreen:

kwag 05-29-2003 09:12 PM

Quote:

Originally Posted by ovg64
now it would be nice if MovieStacker would generate our avs scripts again. :mrgreen:

It's just a matter of time, and a matter of muaddib getting his motheboard fixed :!: His machine went bad (again!) last week, and he told me he would be unavailable for some days until he gets his system fixed. I'm sure he will be surprised when he logs back on :mrgreen:

-kwag

ozjeff99 05-30-2003 12:19 AM

The Motherboard is not broken it is very very tired. Speak to it Muad :wink:

I'm wondering with this application in tandem with a normal Mpeg-1 encoding process whether a new standard is being created..

.....Mpeg-1.5 :?

ozjeff99

audioslave 05-30-2003 01:58 AM

Good morning!

@kwag
Have you tried lowering the maximum bitrate yet? I read that you would try it...
Wow, my head is spinning! This new script really is amazing! Can we finally use 704x576/480 for our encodes?
Another thing: Are you supposed to change the maximum numer of frames per GOP depending on your source? Like 24 for NTSCFilm, 25 for PAL and 30 for NTSC?
Here I go again, bombing you with questions :wink:

And, yes, that "The Foreigner" clip looks simply AWESOME!!! :lol: Did you use the latest Optimal Script for AviSynth 2.5* for that one?

kwag 05-30-2003 05:52 AM

Quote:

Originally Posted by audioslave
Good morning!

@kwag
Have you tried lowering the maximum bitrate yet? I read that you would try it...

Yes, at 528x480 (KVCDx3) I tried a MAX of 2000Kbps and the result is great :)
Quote:

Wow, my head is spinning! This new script really is amazing! Can we finally use 704x576/480 for our encodes?
I think so :!:, just like that sample of "The Foreigner". I used ToK to predict the real CQ with the current script, and it came out to "CQ=63.65" :) Not far from that sample I did at CQ=68, and I did the complete movie with ToK at 704x480 to fit on one CD and looks just like that sample I posted :mrgreen:
I did use a MAX bitrate of 2,500, because at that resolution we need that bit rate for fast action scenes. However, at 528x480, I think we can get by with the MAX of 2000 using the new adaptive script.
Quote:

Another thing: Are you supposed to change the maximum numer of frames per GOP depending on your source? Like 24 for NTSCFilm, 25 for PAL and 30 for NTSC?
If you use ToK, that's exactly what it does automatically, depending on your source frame rate :)
Quote:

Here I go again, bombing you with questions :wink:

And, yes, that "The Foreigner" clip looks simply AWESOME!!! :lol: Did you use the latest Optimal Script for AviSynth 2.5* for that one?
You bet :!:, the one that's currently posted :)

-kwag

audioslave 05-30-2003 06:22 AM

WOW!
Can you use ToK with AviSynth 2.5*? When I tried that TMPGEnc said I had the wrong sampler.dll version... Where can I find a sampler.dll version to work with the new linear script and AviSynth 2.5*?

Krassi 05-30-2003 07:29 AM

Quote:

Originally Posted by audioslave
WOW!
Can you use ToK with AviSynth 2.5*? When I tried that TMPGEnc said I had the wrong sampler.dll version... Where can I find a sampler.dll version to work with the new linear script and AviSynth 2.5*?

@audioslave:
You can get the newest Sampler here:
http://www.jungleweb.net/~sansgrip/avisynth

I have just used ToK and had no problems with the current 2.51 script.


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

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