Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st November 2012, 11:02   #21  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 252
@martin53

You have right, with 18 nov version of your script, on my computer with param "bright=true", green mask appears and with this param at false no green mask with the two Masktools versions.

But well done, with 19 nov version of your script, none green mask, with bright default valor (true) for the two Masktools versions.

Thanks

I try now your last version. I exam your param mod proposals and report you later.
Bernardd is offline   Reply With Quote
Old 21st November 2012, 16:08   #22  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 252
@martin53

Nice script.

I understand the symbol * for substitution picture, but can you explain why the text colors change on this pictures.
two with substitution
frame 002680 november 19 version_1.jpg
frame 002683 november 19 version_1.jpg
two without substitution
frame 002671 november 19 version_1.jpg
frame 002672 november 19 version_1.jpg
Bernardd is offline   Reply With Quote
Old 21st November 2012, 16:16   #23  |  Link
Bernardd
Registered User
 
Join Date: Jan 2012
Location: Toulon France
Posts: 252
Second part and End

To forbidden Fsubstitute process on some frames not blurred for a human read, sThres and dThres param are very effiencies. Today, i prefers to use dThres, because :

sThres is not accurate, so for this picture you can see the result for sThres = 1.05 and 1.25. I must choose 1.45 to forbidden subsitution
frame 002777 november 19 version 1-05_1.jpg
frame 002777 november 19 version 1-25_1.jpg

the Info 4 display give good valors to choose a best level for dThres. As we can see on this three example pictures.
frame 002670 november 19 version_1.jpg
frame 002686 november 19 version_1.jpg
frame 002693 november 19 version_1.jpg

I try filtering in dbgView and OK, no problem, i can list frames processed and write a bookmarks file for AvsPmod.
Bernardd is offline   Reply With Quote
Old 21st November 2012, 20:09   #24  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 408
Quote:
Originally Posted by Bernardd View Post
but can you explain why the text colors change on this pictures.
The subtitle of candidates is green if the candidate meets all requirements to replace the original, red if it's not. Only the winning candidate (always green of course) has an asterisk.

The original clip's top line subtitle is white if it does not need substitution by thresholds, pink if it needs substitution but no candidate meets all requirements, green if substitution will be made.

maxErrC etc are not exact values: the script loosens this limit when the current frame is very blurred. Maybe you wondered about the fQ figure.
fQ is the quality factor between the current frame and the best frame in the (-5...5) range. That means: if the current frame only has half the 'quality' than the best frame in this range, all maxErr limits are multiplied by 2. This helps to keep maxErr small, yet allow substitution of frames that drop significantly in their neighbourhood.

And then forceF is another tool for very bad frames. If a frame's quality is below the average of its two direct neighbours and if still no substitution candidate meets the limits, another try is made with FreezeFrame of the better of the two direct neighbours. This candidate profits from a much higher maxErr. The idea behind it is, that the eye will not so much notice that the frames is just copied, but it will notice single very bad frames.
martin53 is offline   Reply With Quote
Old 21st November 2012, 21:46   #25  |  Link
Wilbert
Super Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,375
So which version of which plugins do I need in order to use this plugin?
Wilbert is offline   Reply With Quote
Old 21st November 2012, 23:00   #26  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 408
Wilbert,
welcome!

Please have a look at the end of the script in the change log. The plugins with their tested versions are documented there since the 11/19/2012 version of the script.

Today I updated to MaskTools v2, but did not release the new script yet.
martin53 is offline   Reply With Quote
Old 22nd November 2012, 05:29   #27  |  Link
matfra
Registered User
 
Join Date: Jul 2009
Posts: 111
Hi,
I download the script and all the plugins. I tried the command line with no parameter. There is no change in the video. Can you give me some exemple how to call the script. Do I need to specify some frame to work on?
matfra is offline   Reply With Quote
Old 22nd November 2012, 19:42   #28  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 408
matfra,
the script is guided by a value every frame produces - the sharpness, or quality how I'm going to call it more and more.

The actual value depends strongly on your given clip. If your clip produces higher numbers than the threshold default that comes with the script, there will be no processing at first.

I suggest that you call it with info=4. You will then see the quality values of some preceding, the actual and some following frames close to the top left.

Then call it with qThres=the_value_you_read_with_a_known_good_frame. That will activate processing for all frames with a lower value.

Info=4 will also show you then if some frames close to inferior frames could be used to enhance them.

Last edited by martin53; 15th December 2012 at 16:42. Reason: dThres is qThres in newer versions
martin53 is offline   Reply With Quote
Old 23rd November 2012, 21:51   #29  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 408
Current version from 11/22/2012 onwards now allows the full restoration with interpolation or freeze of up to 5 (interpolation), or 10 (freeze, allows scene change in gap) consecutive frames that are completely unusable.
It is a quick hack compared to the rest of the script, so please don't be upset, but inform me about malfunctions.

Example see clip from this post

Code:
>Your Source filter here to open the file<
crop(10,0,-326,0).addborders(10,0,326,0)  #because the file already shows before and after, remove after version
DuplicateFrame(10,10,10,10)  # just to make it a little worse around frame 10
FSubstitute(mode=2,info=3)  # mode=2 settings were prepared for this example
martin53 is offline   Reply With Quote
Old 23rd November 2012, 22:37   #30  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 408
Frame replacing is also thoroughly dealt with in this thread.

However, one question is
Quote:
how to *detect* a frame that needs replacing. ... The problem here is that there is no generalised meaning of the phrase "bad frame"
So far, I am aware of the follwing types of frame damage
  1. blur from e.g. camera motion
  2. artefacts from compression (e.g. content change with constant bit rate) - Typical case: motion start leads to camera blur, which in turn makes the codec remove sharp small structures. Structures recover only after some time with free bandwith.
  3. VHS tape or head noise, black lines
  4. Super8 duct-tape, scratch
  5. Super8 film transport, big dust
  6. duplicate frames from unreliable capture system
While problems #1-3 generally leave the global frame position in a usable state, problems #5-6 contain frame content that is not wanted. These latter defects would need FSubstitute(...create=true...).

The function cQuality() as published with the script takes the amount of edges in a frame as the quality measure, and the parameter qThres designates all frames below that threshold as 'bad' frames.
That should work from the start with problems #1, #2, maybe #3 and maybe #4, with the example of my previous post also with problem #5.

Problem #5 might also be detectable with RT_AverageLuma(c).

Problem #6 can probably be detectable with function 2-RT_LumaCorrelation(c,c,delta=-1) inside fQuality(). Bad frames should have a quality of exactly one.

Yet I feel that with problems #3-4 there might be no general answer.

Your contributions are welcome.

Last edited by martin53; 15th December 2012 at 16:48. Reason: description of compression artefacts
martin53 is offline   Reply With Quote
Old 27th November 2012, 19:59   #31  |  Link
Wilbert
Super Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,375
How do i disable the interpolating and compensating? These are way too slow for the clips i want to try. I want know which frames are detected as being too blurry and they should be replaced by freezing (at least if there is a good replacement).
Wilbert is offline   Reply With Quote
Old 28th November 2012, 21:19   #32  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 408
Please have patience one or two more days.
With the published version, set rangeC=0 and rangeI=0.
But because a lot of the time is consumed in the global motion compensation preprocessing, that will not speed up the script much.
In a newer version, I added a parameter PreMoCo that can be set to false, if you just want 1:1 freezeframe copies. This does indeed boost speed.
I just do not want to publish that today, because something else is wrong in it and I don't want to spread a buggy version.
martin53 is offline   Reply With Quote
Old 30th November 2012, 21:04   #33  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 408
Wilbert,
you may now try the 11/30/12 version with preMoCo=false.
I also suffer from the ultra low speed (down to 0.4 FPS when most frames need processing).
But I noticed that MFLowInter and MCompensate make significantly improved frames when they get them with as little global offset as possible. So it really is a quality vs. speed issue.
This might be a situation where a new plugin could boost speed. I have no idea how I could speed up the script inside the AviSynth limitations. A lot of tweaks are already built in to avoid redundant processing.

I also think of preparing a motion log file with MDepan and preconvert that with an external tool, because the script needs the relative motion between the current frame and all frames in the +-5 ranges. The MDepan log writes the motion between adjacent frames, so FSubstitute would need to read 5 lines and add them - not effective. I do not like multi pass approaches, too.

But that would only save time consumed for motion estimation (since it would have to be done once, not again and again with every frame). Much time is also used for global frame transformation with quad().

EDIT: version 12/15/2012 is again optimized and faster

Last edited by martin53; 15th December 2012 at 17:15. Reason: another update to 12/02/2012
martin53 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.