Quantcast Avisynth: Motion Adaptive Filtering Now Possible? - Page 16 - digitalFAQ.com Forums [Archives]
  #301  
06-04-2003, 04:19 AM
Jellygoose Jellygoose is offline
Free Member
 
Join Date: Jun 2002
Location: Germany
Posts: 1,288
Thanks: 0
Thanked 0 Times in 0 Posts
Currently testing the Latest Script... It seems that CQ goes down for me, however, I can's talk about the picture quality yet... Is that about right?
__________________
j3llyG0053
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #302  
06-04-2003, 07:02 AM
girv girv is offline
Free Member
 
Join Date: Sep 2002
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to girv
From the latest script:

Code:
ScriptClip("nf > scd_trigger ? MergeLuma(blur(MaxTreshold)).MergeLuma(blur(MaxTreshold)) : MergeLuma(blur(0.01))")
Surely "nf > scd_trigger" will only be true for the frame before the scene change, so the frame after the change will only have the 0.01 blur applied?
Reply With Quote
  #303  
06-04-2003, 07:14 AM
girv girv is offline
Free Member
 
Join Date: Sep 2002
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to girv
@kwag: I did some tests with blurring different numbers of frames around scene changes and it seemed to increase filesize in all cases
Reply With Quote
  #304  
06-04-2003, 07:17 AM
DorvalCS DorvalCS is offline
Free Member
 
Join Date: Dec 2002
Location: Montreal, Canada
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to DorvalCS
Testing the new script as well... I too have noticed a decrease in CQ... I went from 70.21 with previous script to 65.11 with the new one!

Not sure about quality at this time either.
__________________
DorvalCS
Reply With Quote
  #305  
06-04-2003, 08:03 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by sh0dan
Quote:
Originally Posted by kwag
@sh0dan,
Can someone make a note in the AviSynth manual, related to "switching" filters dynamically
If it's going to be done, like we're doing here, the mergeluma must be kept on, even in conditional fails (by generating a minimal value ) and avoiding the "overshoot/undershoot" (sort of) effect when the filters are turned on/off.

-kwag
I'm afraid I'm not quite following you there....
Hi sh0dan,

What I mean is that if applying conditional filters, specially blur or mergeluma, they must be applied continuously throughout every frame. Not applied on some frames, and removed on other frames like in an adaptive script. Look at this line:

ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf > 2.5 ? mergeluma(Blur(fmin(nf/16,1.5))) : TemporalSoften(2,7,7,3,2)")

If activity is below the treshold of 2.5, TemporalSoften is applied (mergeluma is cut off). If it's above 2.5 mergeluma is applied (TemporalSoften is cut off).

That's why I added this on the false condition:
TemporalSoften(2,7,7,3,2).mergeluma(Blur(0.01))
So now mergeluma is always on, even on the "false" condition, but with a very low value.
I guess mergeluma(Blur(0.01)) could be added at the beginning of the script instead of here, but for illustration, I added it here.
The first line, which is identical to the sample posted at http://www.avisynth.org/index.php?pa...ditionalFilter except for the value 20 which I changed to 16, shows the "blinking" flaw on several scenes throughout a movie.

-kwag
Reply With Quote
  #306  
06-04-2003, 08:12 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by girv
From the latest script:

Code:
ScriptClip("nf > scd_trigger ? MergeLuma(blur(MaxTreshold)).MergeLuma(blur(MaxTreshold)) : MergeLuma(blur(0.01))")
Surely "nf > scd_trigger" will only be true for the frame before the scene change, so the frame after the change will only have the 0.01 blur applied?
Put this line at the end of your script:
ScriptClip("Subtitle(String(nf),1,45)") and slowly move frame by frame with Vdub. There you can see what's happening on the frame before and after scene changes.

-kwag
Reply With Quote
  #307  
06-04-2003, 08:27 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by girv
@kwag: I did some tests with blurring different numbers of frames around scene changes and it seemed to increase filesize in all cases
I'm getting a consistent average of ~30KB less per minute with the scene change line.
Are you benchmarking "exactly" the same amount of frames on the same clip, with and without this line:

ScriptClip("nf > scd_trigger ? MergeLuma(blur(MaxTreshold)).MergeLuma(blur(MaxTre shold)) : MergeLuma(blur(0.01))")

-kwag
Reply With Quote
  #308  
06-04-2003, 08:31 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by DorvalCS
Testing the new script as well... I too have noticed a decrease in CQ... I went from 70.21 with previous script to 65.11 with the new one!

Not sure about quality at this time either.
Probably because the minumum value for mergeluma is 0.01 instead of 0.1 as it was in the previous script. Change both instances of 0.01 to 0.1 on the mergeluma functions, and that should bring the CQ back up again

Edit: Actually, let's make it better:

ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf > 2.5 ? mergeluma(Blur(fmin(nf/16,1.5))) : TemporalSoften(2,7,7,3,2).mergeluma(Blur(fmin(nf/16,1.5)))")

That just made my file size go down ~150KB per 30 seconds clip

-kwag
Reply With Quote
  #309  
06-04-2003, 09:00 AM
audioslave audioslave is offline
Free Member
 
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
Oh, man... I started encoding "A Knight's Tale" yesterday, before the flashing was removed from the script. This morning I restarted the process with the new script. And now... it's changed again...
Don't get me wrong I think it's GREAT that the script is tested and trimmed . Looks like I'm gonna have to start all over again with my encode .

@kwag
Have you updated the script with the last change you posted? Would be great since I'm not a programmer like yourself, and I have some trouble understanding how the new script works...
Reply With Quote
  #310  
06-04-2003, 09:17 AM
girv girv is offline
Free Member
 
Join Date: Sep 2002
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to girv
Quote:
Originally Posted by kwag
ScriptClip("Subtitle(String(nf),1,45)") and slowly move frame by frame with Vdub. There you can see what's happening on the frame before and after scene changes.
Well now here's a curious one.

Code:
FrameEvaluate("nf = YDifferenceToNext()")
ScriptClip("Subtitle(String(nf))")
...and...
Code:
ScriptClip("nf = YDifferenceToNext()" + chr(13) + "Subtitle(String(nf))")
...produce different results In the first snippet (which is modeled on the current optimal script), nf goes large (>15) after the scene change but in the second nf goes large before the change. I think the second snippet is more correct as the Y Difference to the Next frame should be largest before a scene change, right?

@sh0dan: is this the way its supposed to be ?

The current script only max-blurs the frame either side of a scene change because of this "feature". In the first ScriptClip nf is large before the change so the Blur is clamped to 1.5 and applied to the frame before the change; in the second ScriptClip nf is large after the change so the 2x Blur is applied to the frame after the change. I don't think this is quite what you intended, unless you're considerably cleverer than me (always possible of course

I'd been using a single ScriptClip for my own experiments so thats why I was getting different results from the optimal script.
Reply With Quote
  #311  
06-04-2003, 09:22 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Hi audioslave,

Yes, I just updated the script with the changes above.
I'm going to encode the complete movie, and watch for any "blinks". But I think that the problem is over

Here, I might be pushing the limits a little for a 704x480 on one disk, but here's a "Red Planet" sample, now at 704x480 with CQ of 63.38 to fit on one disk: www.kvcd.net/red-planet-704x480.mpg

-kwag
Reply With Quote
  #312  
06-04-2003, 09:26 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by girv
@sh0dan: is this the way its supposed to be ?
Maybe it's a "Feature"
Quote:

The current script only max-blurs the frame either side of a scene change because of this "feature".
If it's a bug, let's keep it, as I like that bug (feature)

-kwag
Reply With Quote
  #313  
06-04-2003, 09:43 AM
audioslave audioslave is offline
Free Member
 
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
@kwag
WOW! Amazing ! How long is that move?
Here comes the question-nuke once again;
Do you recommend using 112kbps or 128kbps for the audio?
Do you think I should be able to squeeze "A Knight's Tale" onto one CD? It's about 127 min long...
Sorry for being a pain in the ***.
Reply With Quote
  #314  
06-04-2003, 09:51 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by audioslave
@kwag
WOW! Amazing ! How long is that move?
One hour, fourty seven minutes
Quote:
Here comes the question-nuke once again;
Do you recommend using 112kbps or 128kbps for the audio?
I always use 112Kbps, and ALWAYS encode with HeadAC3he with DS2.
Quote:
Do you think I should be able to squeeze "A Knight's Tale" onto one CD? It's about 127 min long...
With the new script, probably yes, but at 528x480. I think that's a little too long for 704x480. Maybe not , it really depends on the action of the movie. Do a small clip and test it out.

And here's another sample that I think speaks for itself
www.kvcd.net/red-planed-action-704x480.mpg

-kwag
Reply With Quote
  #315  
06-04-2003, 09:55 AM
audioslave audioslave is offline
Free Member
 
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
Hi kwag, and thank you for your fast replies (as always!).
What do you mean by "encode with HeadAC3he with DS2"? Downsampling perhaps...?
Reply With Quote
  #316  
06-04-2003, 09:59 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by audioslave
What do you mean by "encode with HeadAC3he with DS2"? Downsampling perhaps...?
"Dolby Surround II"
Reply With Quote
  #317  
06-04-2003, 10:02 AM
audioslave audioslave is offline
Free Member
 
Join Date: Mar 2003
Location: Sweden
Posts: 725
Thanks: 0
Thanked 0 Times in 0 Posts
Yes, of course!
I usually downsample to 44.1 kHz for maximum compatibility. Is that a stupid thing to do? I'll try to squeeze the movie onto ONE CD-R when I come home from work! With your excellent new script of course!
Thanks again!
Reply With Quote
  #318  
06-04-2003, 10:49 AM
Jellygoose Jellygoose is offline
Free Member
 
Join Date: Jun 2002
Location: Germany
Posts: 1,288
Thanks: 0
Thanked 0 Times in 0 Posts
So for encoding at a lower resolution than 704x576/480, will the Scene Change Trigger value has to be changed?
Or is it working with the current script with all other resolutions too?
__________________
j3llyG0053
Reply With Quote
  #319  
06-04-2003, 10:53 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Jellygoose
So for encoding at a lower resolution than 704x576/480, will the Scene Change Trigger value has to be changed?
Or is it working with the current script with all other resolutions too?
I don't know Jellygoose , I haven't tried it. I only tried the script at 528x480 and 704x480. The current "trigger" value should work for all resolutions. Give it a try at 352x240(28 and see what you get, then let us know

-kwag
Reply With Quote
  #320  
06-04-2003, 10:58 AM
Jellygoose Jellygoose is offline
Free Member
 
Join Date: Jun 2002
Location: Germany
Posts: 1,288
Thanks: 0
Thanked 0 Times in 0 Posts
I'm actually thinking about backing up my LOTR Special Extended Edition on one 99 min. CD-R, with the current script at that resolution... I'll do that later and tell you about the results!!
So at KVCDx3 resolution, the current script should also work with no blinks or flashes right?
__________________
j3llyG0053
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Dynamic Linear Adaptive Filtering and Scene Change Detection supermule Avisynth Scripting 3 09-15-2006 01:45 AM
Avisynth: Message from linear motion adaptive filtering? holgerschlegel Avisynth Scripting 7 08-27-2003 04:08 AM
Avisynth: Help with Linear Motion Adaptive Filtering pitoman Avisynth Scripting 2 08-05-2003 12:51 PM
Avisynth: Motion adaptive filtering good enough? bicho_visacoso Avisynth Scripting 6 06-15-2003 06:30 AM
Avisynth: AVS 2.5x Script, Motion Adaptive Filtering problems? Bchteam Avisynth Scripting 15 05-31-2003 12:38 PM

Thread Tools



 
All times are GMT -5. The time now is 07:45 PM  —  vBulletin © Jelsoft Enterprises Ltd