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)

black prince 06-08-2003 10:18 AM

@vhelp,

Gibbs Effect or mosquitos appears at the edge of objects and people,
especially when moving as a very thin wavy chrona. It's more noticable
at low CQ's and for now is believed to be a result of Tmpgenc's inability
to apply bitrate for scene changes due to motion search algo. With higher
CQ the bitrate is overused on every frame. :) If a new filter could trick
motion search to apply more bitrate in action scenes and less in still or
slow scenes, a lower CQ could be used and still have picture quality
similar to using higher CQ. :)

-bp

vhelp 06-08-2003 10:32 AM

ha bp..

Quote:

With higher
CQ the bitrate is overused on every frame. If a new filter could trick
motion search to apply more bitrate in action scenes and less in still or
slow scenes, a lower CQ could be used and still have picture quality

similar to using higher CQ.
..and that's just what Motion Adap.. is all about !! hehe.. right ??

Who is now working on the AVIsynth script now (fine-tuning it) ??
My head is still hurting from the spinning (reading all these pages) I had
printed out a hard copy for offline reading - over 100 pages I think.


@ bp..

:idea: Are you going to include a script in your DOWNLOADS section for this script ??
..and the all the necessary filters required for this script ??

:idea: This could really be useful and would really help lots of us out here w/ this
new script.

I just finished working out an
issue w/ the latest version of AVIsynth (v2.52) and have also D/L'ed all
filters for this version, so that I wouldn't have to later on. I'm now happy
thus far :)

Well, I can't wait to start trying this script out. I'm not sure if I have everytihng,
but I do hope that all work out w/ out too much issues :)

Thanks everyone (for all these crazy ideas - - keep them comming)
-vhelp

DKruskie 06-08-2003 10:54 AM

I just happen to take a peak to see if the optimal script was changed and I found something..there is nothing assigned for the Unfilter in the script...Here is the script .

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

## Defined Variables and Constants ##
#
MaxTreshold = 1.50
scd_trigger = 15 # Scene change trigger value.
nf = 0 # Current frame.
#
####

## Main section and static filters ###
#
Mpeg2Source("Your_D2V_Source_Here")
#
undot()
Limiter()
asharp(2, 4)
BicubicResize( Your_Resize_Values_Here )
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 > 2.5 ? asharp( -(fmin((nf/35), 1)), 0 ) : \
TemporalSoften(2,7,7,3,2) ")

#
# Scene change detection ( kwag ) - If a scene change is detected, we
# blur heavily. This affects the scene before and the one after the
# scene change, thus providing a softer transition for the encoder instead
# of a sharp "spike".
# If it's not a scene change, then we just blur dynamically, depending on
# the action.

ScriptClip("nf > scd_trigger ? asharp( -2,0) : asharp(0,0) ")

#
#
#

#LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker!
#AddBorders( Your_Values_Here ) # Depends on situation. Use MovieStacker!
Limiter()

#
#
## Functions ###

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

#
####


David

kwag 06-08-2003 10:56 AM

Hi David,

Yes, you're right :D
I forgot to remove the "LoadPlugin("C:\Filters25\UnFilter.dll")" line :!:
So you might as well delete it from the script.
I'll update the script later today.

Thanks,
-kwag

jorel 06-08-2003 12:24 PM

:wink:

thanks for all hints bp.

i have Diskeeper 7.0, isn't installed now but is very cool.
don't know if i have ace utilities ...searching.
if i can't find it i download the trial.

a backup of the registry and then compresses it?
i never did but is the very cool hint.

thanks :wink:

ps:
i don't have fear to edit the registry cos
before this i do a ghost image. :wink:

i am writing the guide to make a boot cd with ghost that i
use for more than a year in the portuguese forum for
backup the system and i will post all in zip file
with images to burn in nero.
i'm making my little page only with images and zip files
and turn my dvi connection to dsl, than will be easy to post...
only will need that you have the ghost .exe and nero.
this i can't post.

:!:

vhelp 06-08-2003 12:32 PM

@ jorel..

Sorry for off-topic here, but..

I'd be interested in having a look at your guide :)
I use NGhost but could never figure out HOW to make my CDRW a bootable
disk.. I always have to insert a 3 1/2 diskette :(

-vhelp

vhelp 06-08-2003 12:47 PM

@ Kwag..

Sample from Page 27 (repeated here)...
* http://www.kvcd.net/red-planet-19second.mpg

Your sample above...
* Did you do this one based on a chapter ??
* OR, did you just merge a bunch of scenes gotether ??

I was hoping to give this one a shot of encode, but using 720 as my max
resolution. 544 works ok in my AD-1500, but still produces some minor
zizags on diaginals. But, that 704 res. came out pretty good on your sample though :wink: The 720 is PERFECT for me though !! For me, I'm a
step up on the higher scale of quality FWIW :wink:

Also, I noticed that on that sample above, it would seem that brighter lit
scenes, do come out nicer looking (or is it my eyes)

-vhelp

kwag 06-08-2003 01:21 PM

Quote:

Originally Posted by vhelp
@ Kwag..

Sample from Page 27 (repeated here)...
* http://www.kvcd.net/red-planet-19second.mpg

Your sample above...
* Did you do this one based on a chapter ??
* OR, did you just merge a bunch of scenes gotether ??

I just picked a random start point, and encoded that clip. Its not different scenes merged. It's a complete un-edited 19 second encode.
Quote:

Also, I noticed that on that sample above, it would seem that brighter lit
scenes, do come out nicer looking (or is it my eyes)
Depends on the film. Usually dark scenes are bad for any MPEG-1/2 encoder, but that's where the KVCD "Notch" matrix shines :wink:

Edit: Also, play that clip with WinDVD or better yet VideoLan client player :D. Don't use WMP :x

-kwag

vhelp 06-08-2003 01:39 PM

@ Kwag..

Quote:

Edit: Also, play that clip with WinDVD or better yet VideoLan client player . Don't use WMP
Actually, my order of preference SW players are:
* PDVD v3.0 (4:3 [Change to 1024x768], 16:9 [Change to 1024x768, [x] Keep AR]
...and keep color set to "0" (for my LCD screen)
...why ? cause when viewing 16:9 encodes/DVD movies, it keeps 16:9 AR !!
* WDVD v3.0 (has no AR changing, keep colors at ( max-8 )=PDVD's)
* Zoomplayer v2.90 (if using MPEG-2, it crashes on my pc otherwise, but
...MPEG-1 and other formats ok)

Red Planet, (and others)...
When I'm doing test encodes, using smartriper v2.27, I usually just do the
first VOB or 10 chptrs, which is what I did today, unless someone asks me
to help them out w/ encoding testing or I'm debuggin a scene elsewhere.

There's always a method to my madness.. So far, so good.
-vhelp

totonho03 06-08-2003 02:38 PM

Jealousy (Not the tango)
 
I am just soooo jealous (and full of envy) to see all of these wonderful ideas floating all around me, and not being able to at least experiment and make believe that I am learning something..... Actually, I have learned a lot just by reading the threads, not to mention the help received with conversations held with "El Maestro" Sr. Kwag. I should also mention that Mr. Black Prince and Red m, have helped a lot towards my understanding of this wonderful KVCD world you (and sometimes myself), are evolving around.
I am going to wait a little bit more for the new optimal script, and see if I can get back to releasing my stress, and create a KVCD. Meanwhile I will try to clean up my registry (Thanks Jorel and BP) and load the new version of Avisync with their respective filters

Senor Kwag: Are you planning on updating the CD test version? Just asking about it.

Thanks to you all

Totonho03

kwag 06-08-2003 02:43 PM

Re: Jealousy (Not the tango)
 
Quote:

Originally Posted by totonho03

Senor Kwag: Are you planning on updating the CD test version? Just asking about it.

I don't think so, because the test CD is really for testing the playback resolutions on standalone players, and they are all in there :)
It's really not a "quality test" CD.

-kwag

black prince 06-08-2003 03:04 PM

@Kwag,

I was browsing thru old posts and came across this link:

http://shelob.mordor.net/dgraft/msmooth/msmooth.html

I haven't tried MSmooth, but it looks promising. We need a
"proactive filter for mosquitos" (as SansGrip would say). Undot(),
DCTFilter, Unfilter, etc. are worth a try if the source is already
contains Gibbs effect. But to correct this before it happens is
another issue. Give me your opinion about MSmooth :)


-bp

vhelp 06-08-2003 03:19 PM

@ bp..

ok, so NOW I know what Gibbs are :!:

So, then, the other thing I was going about is relating to something else..
Great!! Ok, mov'en on..

FYI: I see that this filter is for AVIsynth v2.5
* http://shelob.mordor.net/dgraft/msmooth/msmooth.html

-vhelp

vhelp 06-08-2003 03:26 PM

.
.
About Gibbs and Encoding..
I was looking at the two pics (beore/after) and studying them. Now, I have
a few questions as a result:

* Are these gibbs produced DUE TO an effect of the encoding source materials ??
* OR, is it a LEFT-OVER artifact AFTER the encoding process ??

After looking at MSMOOTH's final result, I'm wondering if this will increase
our encoding qulaity and size, or will it not matter. I mean, I know it will
make the final encode look better. Is this a cosmetic fix to the final encode, and as a plus, decreases our size, or what.. just wanna get a better
understanding :!:

-vhelp

jorel 06-08-2003 04:14 PM

Quote:

Originally Posted by kwag
@Black Prince ( and all! ),

I just did a quick test, by changing the motion estimation to "Fast" in TMPEG, and there are CLEARLY less Gibbs. Maybe with the new adaptive method of filtering, we can use this motion estimation, and even though the CQ might be slightly smaller than with "High Quality" estimation, the final quality will be better :idea:

Edit: I just did two encodes with ToK. One with "High quality" and another with "Fast"

Here are the results:

http://www.kvcd.net/red-planet-sampl...on-cq62.70.mpg
http://www.kvcd.net/red-planet-sampl...y-cq63.031.mpg

I can clearly see less Gibbs with motion estimation set to "Fast".
If you want to try this with ToK, change the line in the file "video.en1" that reads:

Job.MPEG.Video.MotionSearchSpeed=MPEGVideoEncoder_ MotionSearchSpeed_Slow

To:
Job.MPEG.Video.MotionSearchSpeed=MPEGVideoEncoder_MotionSearchSpeed_MotionEstimate

Not to mention that the encoding speed is now a rocket :)

-kwag


Kwag,
i was trying and don't got results...
than i see that we have 2 files "video.en1" in ToK.
one file is in "opt" folder and another in "work" folder.

than i change the :arrow: "video.en1" in the "opt" folder.
working faster now.
thanks.

the quality remains after the change?
i don't see more posts about this.
no one more try the change?
:?:

black prince 06-08-2003 04:22 PM

@Kwag,

Kwag wrote:
Quote:

@Black Prince ( and all! ),

I just did a quick test, by changing the motion estimation to "Fast" in TMPEG, and there are CLEARLY less Gibbs. Maybe with the new adaptive method of filtering, we can use this motion estimation, and even though the CQ might be slightly smaller than with "High Quality" estimation, the final quality will be better

Edit: I just did two encodes with ToK. One with "High quality" and another with "Fast"

Here are the results:

http://www.kvcd.net/red-planet-sampl...on-cq62.70.mpg
http://www.kvcd.net/red-planet-sampl...y-cq63.031.mpg

I can clearly see less Gibbs with motion estimation set to "Fast".
If you want to try this with ToK, change the line in the file "video.en1" that reads:

Job.MPEG.Video.MotionSearchSpeed=MPEGVideoEncoder_ MotionSearchSpeed_Slow

To:
Job.MPEG.Video.MotionSearchSpeed=MPEGVideoEncoder_ MotionSearchSpeed_MotionEstimate

Not to mention that the encoding speed is now a rocket

-kwag
I checked Tmpgenc Settings after changes and found "Motion Search Precision" is still
set to High Quality (Slow) instead of Low Quality (fast) after your change.
I manually changed motion search and Gibbs lessened even more and
the encoding time dropped by 2 hours :?: I don't know if editing video.en1
will make this work.

@vhelp,

I tried MSmooth() instead of UNDot() and used default settings. It did
something alright. It caused the picture to be blurry, encoding time to
increase by 4 hours and of course Gibbs was decreased. This filter needs
tweaking. I commented UNdot() and MSmooth() to see if picture
quality decreased without them and it stayed the same. I will play around
more with MSmooth(), but the script appears pretty good already without
them. :D

-bp

jorel 06-08-2003 04:31 PM

hey bp,
read my last post about the change of "video.en1" file.
works ok and faster.
:wink:

vhelp 06-08-2003 04:37 PM

@ bp..

Can I vear from the topic slightly ??

Thanks bp.. right now, I'm batteling two things.
1, a slowly forming head-cold :(
2, Major problem getting VFAPI working.

As for line 2..
if you don't mind my vearing off slitely.. only because I'm banging my head
on this one..

1 - I've successfully installed AVIsynth v2.52, and all working great.
2 - I seem to have the filters working. I can open my captures just fine :)
3 - But, MAJOR issue w/ .D2V files. They won't open !! And, I need help !!

Ok, I have VFAPI v1.04 right ?? As, that's what I'm using on my MAIN pc
w/ no problems. So, I copy all my MAIN pc's files to my 2nd PC and run
the VFAPI.inf install and tell it the NEW directory (in the same as vdub)
* vdub files and directories
* dvd2avi files (including .vfp)
into a new folder on my 2nd PC and proceed to assume I installed all correctly.

* Now, when I open dvd2avi w/ a VOB file, and create my project .d2v file,
all is well.
* Then, when I open "VFAPIConv-EN.exe" and drag my .d2v file to convert,
all is well to. It converts.
* Then, when I drag the converted VFAPI.AVI file into vdub (as I do on my
MAIN pc w/ success all the time) IT DOESN'T WORK!!
I keep getting the error message: "cannot determine file type" ratts!!

So, please tell me, did I miss something ??

Thanks all, for any assistance.
-vhelp

audioslave 06-08-2003 05:31 PM

Thank you for the tip about changing the "motion precition" in the "video.en1" file! :wink:

Now onto another problem. I have ripped a movie and I can't get correct resize values. When I open the "*.d2v" file in MovieStacker I get all info (correct I believe) but when I start encoding it in TMPGEnc I get a screwed up aspect ratio! Any ideas on why?
The movie is mixed NTSC/NTSCFilm and in the 4:3 format. In MovieStacker it says the movie is PAL and Anamorphic 8O . When I try encoding it with those values the height gets messed up. Inversed egg-head effect (squashed)... And when I uncheck PAL and Anamorphic the aspect is correct althought the movie is not centered but sort of in the upper region of the frame - and with thick borders on the sides??? Please help me, I have no idea of what to do! :cry:
I've never had this problem before. I usually encode PAL movies and the resize values have always worked...

HEEEELP!!


EDIT: I also get a thick green line at the bottom of the frame!?

audioslave 06-08-2003 06:04 PM

Never mind my last post. I removed MovieStacker and unpacked the *.zip again to start fresh and now it works :oops: .
Don't know what happened...?
Sorry to bother you.


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