digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Script Challenge - Gentlemen, start your editors... (http://www.digitalfaq.com/archives/avisynth/3884-avisynth-script-challenge.html)

Wilbert 07-05-2003 10:26 AM

Sorry, forgot to respond ...

My script was the following:

1) Used force film in dvd2avi. Normally I would do this in AviSynth, but I was to lazy to install the newest decomb (I got some problems with the installed one).

2) Used the following script:

# LOADING QUANTIFIED MOTION FILTER SCRIPT
Import("E:\temp\QMF\qmf-1.4a1.avs")

# LOW MOTION FILTER FUNCTION
# -> SHARP RESIZING + TEMPORAL ONLY
function Low_Motion_Filter(clip c)
{
c.TemporalCleaner(5, 10)
}

# MEDIUM MOTION FILTER FUNCTION
# -> NEUTRAL BICUBIC RESIZING + TEMPORAL & SPATIAL
function Medium_Motion_Filter(clip c)
{
c.FluxSmooth(7, 7)
}

# HIGH MOTION FILTER FUNCTION
# -> SOFT RESIZING + SPATIAL ONLY
function High_Motion_Filter(clip c)
{
c.FluxSmooth(-1, 14)
UnFilter(-30, -30)
}

# OPENING VIDEO SOURCE
Mpeg2Source("E:\temp\QMF\test.d2v") # used force film in dvd2avi

# APPLYING ADAPTATIVE RESIZING FILTER (USING QMF)
QMF()

# Resulted clip contained much blocks. I used BlockBuster to reduce it a bit.
BlockBuster(method="noise")

3) Fed it in TMPGEnc with the following settings:

video tab:
- Motion search precision: highest quality
- 2-pass vbr, settings:
average bitrate 860
maxium 1200
minimum 400
enable padding

advanced tab:
- cropped the image to 352x240 (not sured whether this was the correct thing to do, but you all seemed to have done it)

quantize matrix:
- MPEG standard
- use floating point DCT
- no motion search ...
- didn't use "soften block noise", because I could see no difference

*) A final word about the script. I used the filter settings of iago (given in the same thread as QMF). I was to lazy to try other filters ...

kwag 07-05-2003 11:50 AM

My sample
 
Ok, here's my last sample, done with the current script. I did it again, because the first sample I posted was quite a while ago, and I believe the script was not fully optimized as it is now. I used the current script as it is posted, with the following minimal adjustments necessary for the low resolution of 352x240:

Changed asharp(2, 4) to asharp(1, 4) because it was too strong for 352x240.
Processed with Telecide() and Decimate(), necessary because the original source was FILM.
Added Wavelet Noise Filter (VagueDenoiser(2,1) as a test ) ;)
Increased the filter boundary switching treshold from 2 to 3. Necessary also because of the lower resolution. The script in the "Optimized Scripts" section is really optimised for resolutions of 528x and above. Not for 352x240. So this one is :!:
Other than that, the script is identical (same framework) as the optimal script posted. It was encoded with a MIN bitrate of 300 and a MAX of 1,200Kbps in CQ mode with a value of 72.5 Here's the sample, followed by the script listing:
www.kvcd.net/mrtibs-kwag.mpg
Code:

## DLL Section ##
#
LoadPlugin("C:\Filters25\MPEG2Dec3.dll")
LoadPlugin("C:\Filters25\GripFit_YV12.dll")
LoadPlugin("C:\Filters25\STMedianFilter.dll")
LoadPlugin("C:\Filters25\asharp.dll")
LoadPlugin("C:\Filters25\undot.dll")
LoadPlugin("C:\Filters25\unfilter.dll") 
LoadPlugin("C:\Filters25\VagueDenoiser.dll")

#
####

## Defined Variables and Constants ##
#
MaxTreshold = 1.50

nf =  0 # Current frame.
 
#
####

## Main section and static filters ###
#
Mpeg2Source("C:\download\test.d2v")
telecide()
decimate()
VagueDenoiser(2,1)
#
undot()
Limiter()
asharp(1, 4)
BicubicResize(336, 208, 0, 0.6, 8, 16, 336, 208)
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.2))
#
#

## Dynamic Linear Adaptive Filtering and Scene Change Detection ##
#
# ( Portions from AviSynth's manual ) - This will apply temporalsoften to
# very static scenes, and apply variable blur on moving scenes.
# We also assign a variable - and this is why a line break is inserted:

ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= 3 ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) ,0, 2) ")
AddBorders(8, 16, 8, 16)
Limiter()
#
#
## Functions ###

function fmin( int f1, int f2) {
  return ( f1<f2 ) ? f1 : f2
}

-kwag

vhelp 07-05-2003 09:39 PM

@ Kwag.. or anyone..

I'm playing around w/ the "script challenge".

I don't know what Limiter() does.

* What's it's function ??
* and, why do you include it twice ??

Thanks,
-vhelp

kwag 07-05-2003 09:43 PM

Quote:

Originally Posted by vhelp
* What's it's function ??

Full description here: http://www.avisynth.org/index.php?page=Limiter
Quote:

* and, why do you include it twice ??
Just in case any of the filters between the first use and the end of the script decide to mess up the luma or chroma range ( Suggested by SansGrip a long time ago ;) )

-kwag

Wilbert 07-06-2003 08:21 AM

Yeah, I also should have included it. But there's no reason to include it twice, it only takes more time.

kwag 07-06-2003 10:15 AM

Quote:

Originally Posted by Wilbert
But there's no reason to include it twice, it only takes more time.

I just gave an explanation why it should be used twice :!:
There's a very good reason to include "Limiter()" or "LegalClip()" twice ;) http://www.kvcd.net/forum/viewtopic.php?t=2071

-kwag

Wilbert 07-06-2003 10:42 AM

Sansgrip know a lot more about programming than I do:
Quote:

The first LegalClip gets rid of out-of-range values before any other filter gets a chance to mix them up with nearby correct values, by resizing or whatever.
But to me, it seems to me that it doesn't matter whether you feed the resizers with YUV [0-255] or YUV [16-235], or anything between.

MrTibs 07-07-2003 06:32 PM

My final submission..
 
I hope you guys don't object but my final submisison includes a hacked version of MotionMask called MADMask. (It is basicly the same but used MAD to determine motion areas as well as paying special attention to edges.)

Quote:

LoadPlugin("c:\avisynth\MPEG2DEC.dll")
Loadplugin("c:\avisynth\decomblegacy.dll")
LoadPlugin("c:\projects\video\madmask\debug\madmas k.dll")
LoadPlugin("c:\avisynth\dustv5.dll")
LoadPlugin("C:\avisynth\STMedianFilter.dll")

MPEG2Source("c:\avisynth\test.d2v")

Telecide()
Decimate()


clip=STMedianFilter(10,50,8,10,10,50)
mask=MADMask(3,30,true,false)
maskedmix(temporalsmoother(5,1),clip,mask)

Pixiedust()
Encoded min 300, 1200 max, CQ 75

vhelp 07-07-2003 08:29 PM

@ MrTibs..

Sorry for coming in so late in the game here.. But as you know, I was trying
my hand at your script challenge over the weekend, but got sidewinded hehe..

Anyways, I did do a "final" encode, and I think I still have the clip some
where's but I can't seem to find the script I used. I did a no-no.. I typed
over my snips 8O.

I'll try and remember what exactly I did. But, I'm not too sure. So, don't
be mad, if I post sample but w/ script ta back it up - - K?

I was gonna try my hand at it one more time this evening. We'll see. But,
mabe I'll post my sample for you to add to the collection anyways ??

Looking forward to hearing your directions.
-vhelp

vhelp 07-07-2003 10:58 PM

Hi guys.

Ok, here is my final encode version to add to the collection:

--> mrtibs-vhelp.mpg

In short, I ended up having to re-do from scratch, w/ trial and error encodes
a dozen times or so, before I reached a final satisfaction level, and with
5 minutes ta spare or so hehe.. or whenever this reaches its final
conclusion :)

Hope the next challenge is done on a better test source :wink:
-vhelp

MrTibs 07-08-2003 01:20 AM

Well the end has come. All entries are in and now its time
 
Everyone is free to vote as they wish but I'm going to leave my voting results to my poor unsuspecting family. Once these poor suckers have been tortured enough, I'll post their comments.

kwag 07-08-2003 01:27 AM

Submitted by MrTibs: www.kvcd.net/MrTibs_attempt2.mpg

Wilbert 07-08-2003 03:49 AM

Can you make a poll?

Bchteam 07-10-2003 05:21 AM

Quote:

Originally Posted by vhelp
Hi guys.

Ok, here is my final encode version to add to the collection:

--> mrtibs-vhelp.mpg

In short, I ended up having to re-do from scratch, w/ trial and error encodes
a dozen times or so, before I reached a final satisfaction level, and with
5 minutes ta spare or so hehe.. or whenever this reaches its final
conclusion :)

Hope the next challenge is done on a better test source :wink:
-vhelp

Looks Great, vhelp :!:

Can you post your script for that encode :?:

rendalunit 07-10-2003 02:00 PM

when can we vote?

vhelp 07-10-2003 05:27 PM

hi Bchteam..

Bare w/ me :)

I just got home, and I have a number of things going on. I'll try and jugle
each items as best I can. Maybe a bit later. K? This time, I have the script.

Thanks for your OP. :)
-vhelp

Peter1234 07-10-2003 11:08 PM

I am not sure if I am allowed to vote, but I looked at all of the videos and I thought that MrTibs_attempt2.mpeg was best. However, I couldn't find a source for MADMask. Perhaps he could post it.

vhelp 07-10-2003 11:21 PM

As requested, below is the script I used in the "test.m2v" challenge.

-vhelp
--------------------------------------------------------------

Code:

## Defined Variables and Constants
 MaxTreshold = 1.50
 nf =  0 # Current frame.

 ## Your MOVIE source goes here (avi or d2v)
 ## SegmentedAVISource(x)
 Mpeg2Source("h:\vfapi\test.rgb.1.d2v")

 undot()
 Limiter()

 ## our MA script(s) here..
 ## --------------------------------------------------------
 converttoyuy2()
 fluxsmooth(15,10)
 converttoYV12()

 ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= 2 ? \
 unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
 Convolution3d(0, fmin( round(2/nf), 6), 16, 12, fmin( round(3/nf), 6), 10, 0) ")
 ## --------------------------------------------------------

 Limiter()

 ## Functions
 function fmin( int f1, int f2)
  {
    return ( f1<f2 ) ? f1 : f2
  }


MrTibs 07-11-2003 12:27 AM

You can't find MADmask on the net because it is my personal hack. MADmask is VERY MUCH a work in progress but I'll post the filter at my first opportunity.

I am setting up a personal web page to host my filters but for now if you send my your email, I'll send you the filter. Personally, I don't think that the filter is good enough to be included with the Avisynth list but I am using it with my encodes.

Peter1234 07-11-2003 01:43 AM

MrTibs,
Thanks, but I can wait until you think it is ready to post.


All times are GMT -5. The time now is 04:24 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.