Log in

View Full Version : ExBlend deblender - v1.03b2 - 06 Jan 2013


StainlessS
8th October 2010, 01:57
ExBlend() By StainlessS

Unfortunately, VBulletin forum does not allow old thread title change so have opened new thread here:- https://forum.doom9.org/showthread.php?t=175948

In brief:

ExBlend() v1.04

YV12, YV16, YV24, YV8, YUY2 PROGRESSIVE source. Avisynth v2.5+ (YV12 & YUY2 only for v2.58 plugin)

Avisynth v2.58, avs/+ 2.60 x86 and x64 dll's.
Filter for detecting pairs of blends and replacing them with un-blended frames.

The filter is specific to a particular type of blending, where the source was 24 FPS
Progressive, and converted to 30 FPS (eg Film to Video CD) by blending as in below:-

A B C D # 24 FPS Source (6 blocks of 4 frames = 24 FPS)

A B cb cd D # Blended to 30 FPS (6 blocks of 5 frames = 30 FPS)

The original frame C was thrown away, leaving a repeated sequence of 3 good frames
and 2 blended frames. The framerate may then have been slowed by 0.1% to 29.97 FPS
for NTSC (American) color TV standards.

The filter will also deal with similarly blended 25 FPS to 30 FPS video in which case
the blending would be as below:-

A B C D E # 25 FPS Source (5 blocks of 5 frames = 25 FPS)

A B cb cd D E # Blended to 30 FPS (5 blocks of 6 frames = 30 FPS)

Again, it may be slowed to 29.97 FPS. In this case there will be a repeated sequence
of 4 good, 2 blended frames.

The Filter locates the blended pairs, subtracts the previous frame from the 1st blended
frame, it also subtracts the following frame from the 2nd blended frame and then blends
both of these 'candidate' frames together to 'iron out' any noise and eg compression
artifacts. This should be very close to the original frame 'C' that was thrown away as
noted above.


See MediaFire or SendSpace in Sig for Downloads

TheProfileth
8th October 2010, 06:40
this looks like it could be useful, I will take a look tomorrow

mandarinka
8th October 2010, 15:00
I gather that your filter treats blending of actually progressive frames, am I right?

When I experienced blends (pre-1998 or so anime), they were often irregular - either starting or ending at some line mid-field (and also, the ghost picture would gradually gains/loses stregth). And yeah, they were field-blends, not frame blends, and combined with hard telecined video :(

txporter
8th October 2010, 18:52
Is there a way to use this to recover the original stream that is destroyed by ABC? Here in Austin, TX we receive the feed as 1080i (affiliates upconvert the 720p stream). That 29.97fps stream needs to be run through inverse telecine which leaves a 23.976fps stream with blends.

Currently, I run it through double framerate yadif and the srestore it back to 23.976.

StainlessS
8th October 2010, 21:57
This Filter is mainly intended for retrieval of old stuff.
@mandarinka,
I think but am not sure, that I have seen what you describe, attributed
with the name peculiar blend. Exblend will not touch such source and may
be detrimental to such. Exblend is highly targeted to only one type of blending.
It is NOT a fix all for everything. Of the many deblend type plugins or scripts,
ExBlend is probably the most targeted of all. It deals with stuff that has gone
from eg 24FPS (Progressive) to VCD (mpeg1 does not deal with anything other
than progressive) and so blended field's etc dont come into it.
@txporter
Same again I'm afraid, old stuff really. If you have eg a Blaze Star,Betty Page or
Tempest storm clip, or such, shot on film and transferred to VCD then, this is what
ExBlend was made for. I mention those examples, knowing that ExBlend does exactly
what is says on the tin, for (at least, for some of those examples, I have seen
results on similar). I'm a big fan of DeSpot, great stuff but needs to be fed with
stuff it can deal with, hence ExBlend(). It is less than likely that ExBlend can help
with more modern stuff. Strictly in the realm of vintage recovery.

EDIT: Having read the above, seems that 'stuff' is my new favorite word,
way more genteel than my usual favorite word.

As mentioned in first post, ExBlend comes with EXPERIMENTOR2.AVS which
allows you to play with the filter and familiarize yourself with it. It synthesizes
the type of blending that it deals with and then fixes it. It would therefore also
allow you to see what that type of blending looks like. This AVS, produces a
4 window display with the blended clip, a metrics clip, the deblended result
and an amplified difference between the result and the IDEAL result (which it
also synthesizes). A further supplied AVS, (MAKEBLEND.AVS) just synthesizes a
blended clip so you can save it, compress it and then fix using the also supplied
FIXBLEND.AVS script. FIXBLEND also allows you to play with some of the args
that are not useful in EXPERIMENTOR.AVS, EXPERIMENTOR.AVS will almost
certainly result in a 100% success rate, because it deals with clean and
uncompressed video. The MAKEBLEND/FIXBLEND scripts make for a more realistic
scenario, and will without much fiddling with settings produce in the region of
about 97% success rate (typically srestore would return about 82% for similar
source). FIXBLEND.AVS also allows use of the newly extended (1.02b) manual
override commands which can produce 100% success if you are prepared to spend
a little time creating a command text file. The reality is though that in most cases
any blends that slip though are in static scenes and are not terribly important
(two identical frames blended together look blended neither to the viewer nor Exblend).

StainlessS
10th December 2010, 17:06
This was posted in reply to another thread and should I think be
appended here also:-

Think I made a big mistake there in the description for ExBlend().
Now believe that what ExBlend fixes is 3:2 pulldown that has been blend
deinterlaced and then vertically downsized to half height. The results
are indistinguishable from perfectly blended frames as described for
ExBlend(). ExBlend will not touch 3:2 pulldown blend deinterlaced
that has NOT been downsized.
I had a clip that someone wanted cleaned up, I mistakenly assumed that
it used the ExBlend() description of blended frames and knocked up a script
to fix that problem. I then found that the clip kept going out of sequence
and needed some kind of detector. I was not at the time a regular visitor
to Doom9, and only ever sought filters etc from WarpEnterprises. Not finding
a filter to fix the problem, I eventually dug out a compiler and ExBlend is
the result. This was my first coding (not counting a little bit of VB) in about 14
or 15 years, but it does exactly what I wanted from it and even surpassed my
expectations. I later found a script in the old downloadable Avisynth site
that turned out to be almost identical to the script I had done. Searching
the site I found a link to that particular script that had the name of the author
in it, it was ActionMan133. In Actionman133's writeup, he also made the blended
frames assumption that I had done and so this reinforced my theory as to the cause.
Have recently seen a thread on-site where he obviously re-assessed and came to
the 3:2 blend deinterlaced, resize, opinion. I dont really have much NTSC footage
myself (thank goodness) and have not really had that many samples to try ExBlend
on but those that I have had, ExBlend performed brilliantly. I think that for non
downsized stuff, the only way to go is probably srestore script, srestore (I think)
detects using AverageLuma (or perhaps YDifferenceFromPrevious or whatever its called)
whereas the ExBlend filter actually does a sort of test
deblend to detect. This allows srestore to detect the 'almost blends' produced by blend
deinterlacing but requires a certain amount of clean up of the produced frames.
As Exblend detects what looks like perfectly blended frames, the results do not
really require any extra clean up and in many cases the resulting deblended frames
look cleaner than those on either side. I have been toying with the idea (but not
tried it out yet) that vertically downsizing by half, a 3:2 pulldown clip with
blend deinterlacing, only for the detection in ExBlend mode=1, and then doing
the second pass (mode=2) at full size, this would though not produce clean output
as they were not true blended frames, perhaps I could do some kind of cleaning,
I think that it could potentially be faster than srestore but of course the cleaning
would add extra cost in time.
EDIT: See FixBlendIVTC rather than sRestore.

Chainmax
12th December 2010, 06:43
Interesting....gonna try this on Disney's crappy DVD release of the 1992 X-Men series.

StainlessS
13th December 2010, 21:42
Interesting....gonna try this on Disney's crappy DVD release of the 1992 X-Men series.

If you suspect that it suffered 3:2 puldown, blend deinterlacing
at a higher resolution and then downsized, try plain use ExBlend,
if it after a minute or two that the 'R' (ratio) flag is set (show>1)
then it is not detecting it, try the downsize thing.
Good luck and give us a report, thanks.

EDIT:- have dismissed all thoughts about the downsize thing,
not a good idea.

StainlessS
27th April 2011, 17:54
A few observations I have made recently.

I had a sort of junk area of my hard drive where I had accumulated
several GB of short demo type clips, over about 3 or 4 years, mostly
internet samples in various containers, eg MPG, AVI WMV, & FLV.
I decided that I wanted them off my hard drive and so I eventually
viewed and dumped or recoded them as x264, for eventual archival on DVD.
In the process of doing this, I found about 40 or 50 NTSC clips that
looked like good candidates for Exblend() recovery. Every Candidate
that was identified, was recovered, well. The least best recovery rate
was in the region of 94%+, recovered frames from the original pair
of blends. This leads me to believe that Exblend() is not as previously
told, limited to recovery from VCD clips. The clips recovered varied
in dimension, but all vertically less that 480 (and nearly all of them
29.97 FPS, one or two were 30FPS).

I dont have much in the way of NTSC stuff, so am limited in ability
to do much test on that material. However, much of the "sludge", above
that I had acquired, proved to be good test material.

I guess the main problem is identifying suitable material, so here is a short
description of the blends and how to identify them.

Imagine a clip where the original source clip was of a single telegraph
pole, displaced laterally, due to the vid being taken from vantage point
of a travelling car. The frame before the blend pair would be a single
pole, the first blend would be a blend of the first pole, plus a second
pole. The second blend would be a blend of the second pole and the third pole,
and the frame after the blend pair would be the third pole alone. (These poles
are obviously the same pole, only the position changed).

Not very technical I know, but what I usually do is place my thumb nail
against the first lone telegraph pole, move to the 1st blend pair, identify
that one of the 1st blended poles coincides with the first one, move my
thumb nail to the second blended pole in the 1st blend and then move on
to the second blend pair, if same, then move thumb nail to the other blend
in the second blend pair, and move on to the frame following the second
blend, and compare again. Basically, the blend pair should contain a
common "telegraph pole" not appearing either before or after the blend pair.
It is this "telegraph pole", that Exblend() recovers.

Exblend(), should only be used on PROGRESSIVE material, anything exhibiting
combing should be avoided. ExBlend() uses the average of vertical pairs of
pixels to reduce the effects of noise in the blend detector. I am reluctant
to remove this averaging (and so make it less effective) and also dont
want to add in an extra combing detector which would reduce the speed of ExBlend.
If fed source containing combing, ExBlend() may seem to be working ok (according
to metrics) but this would be false, it would be interpreting the vertical averaging
of combing as blends. It is therefore very important that the user is aware that
combing, is to be avoided.

Do NOT use Exblend() on DirectShowSource(). Directshow decoders (especially
mpg) can do eg deinterlacing or inverse 3:2 pulldown, could be that any
blending you are seeing in your player is actually created by directshow,
and does not exist in the actual file. Any attempt to reverse Directshow
created blending would be better dealt with by other means. If a Directshow
decoder does inverse 3:2 pulldown, it will take a few frames to get into
sync and as ExBlend() requests 7 frames for every target frame, this will
send any directShow decoder doing Inverse 3:2 pulldown into fits, and produce
all kinds of jumps and jerks, decoder "massaging" is not a good idea before
ExBlend().

If you cannot use anything other than DirectShowSource for you source clip,
I suggest converting to an AVI, I habitually use ffmpeg for this.

for eg a WMV to AVI conversions (with ffmpeg somewhere in you path [or
on the same directory as your command and source file])

CONTENTS OF I_WMV_to_AVI.CMD

---------------------
ffmpeg -i i.WMV -vcodec huffyuv -acodec pcm_s16le D:\AVS\IN\i.wmv.avi

Pause
---------------------

The source clips should be named I.WMV and of course the destination file
above is "D:\AVS\IN\i.wmv.avi"


Also, the "Show" modes of ExBlend(), I only really use either
mode 0 (off, during second pass) or 5, other modes are really intended
for me during testing, if an "R" in orange flag is displayed (at the end), then
the clip is not ExBlend() material, if the clip shows less than
about 90% recovery, then I would think that it is not quite right.
In most cases ExBlend() should exhibit a recovery rate of above 95%
although 94% is probably Ok, I have not witnessed any recovery rate
less than about 94% in ExBlend() (with suitable source).
If you need further experience of the type of blend that Exblend()
will recover, try the ExBlend() EXPERIMENTOR.AVS which will simulate
the blending, so you can recognise it (and try the 'thumbnail' thing).

Lastly, would be nice if someone (anyone) could say if they found Exblend()
of use, up to now there has be zero +ve feedback and I'm just a little unsure
if I am the only one who can use it (in which case I am at fault for
not documenting well). If it is of zero use, then perhaps it should be
withdrawn, or would not at all warrent further development, (or at least
further publication).

StainlessS
4th February 2012, 03:35
Am (reasonably) close to releasing an ExBlend update, there follows an un-prepared publication,
just what Ive got presently, twill follow shortly.

The new release, when released, will expose some of the inner workings of Exblend() and give cause
to those better equipt to dealing with masks etc, to write scripts that can better deal with
blending. (hang on, just gotta getta another can out the fridge). Sorry bout that.

There is nothing here plugin wise, just a quickref that I'm knocking up as I work, and I thought I
would give it up for comment, still by no means complete, but if you would like any input, now
might be a good time.

So the meanderings as they are right now, follow.

here's what I've got so far:

EDIT:- Text Removed, see next post.

StainlessS
16th February 2012, 15:46
New Version - ExBlend() v1.03b 15/Feb 2012

A Quickref from new version:-


EVERYTHING HERE OVERRULES OLD DOCS (See old docs Also)

ExBlend() v1.03b+ QuickRef

YV12, YUY2, PROGRESSIVE Only.

Quick OverView, ExBlend() is a plugin to repair damage caused by blend Deinterlacing of telecined clips, which results
in a double blend, every five frames, GGGBBGGGBBGGGBB etc where 'G' is good and 'B' is blend.
Also used for telecined clips that were downsized from 720x480 to VCD 352x240 which look similar to the above mentioned damage.

Exblend(Clip,int "mode",int "pal",float "lockthresh",float "ithresh",int "show",string "ExBfile",bool "ver",bool "revip",
string "override",int "lv",int "dv",int "disp",clip "Dclip",int "CompUB",bool "Decimate",int "DecompIx",int "DecClpIx",bool "Debug")


Mode 0: Free Running Mode (Deprecated) --------------------------------------------------------------

Arg Type Min Max Default Comment

clip clip clip clip NONE YV12 & YUY2 PROGRESSIVE
Pal int -1 1 0 PAL = -1, ONLY allowed HERE in MODE 0
LockThresh float 0.0 100.0 1.0 default rarely needs change.
IThresh float 0.0 100.0 3.0 default rarely needs change.
Show int 0 5 5 Metrics (0=OFF,5=FULL, either of these two most usual)
Exbfile string - - "ExBlend" Project: (logging Only), 'exbfile'.XBD Not created.
Ver bool False True False ALL ARGS IGNORED if true
Revip bool False True False Reverse Metrics Direction when show > 1
Override string - - - IGNORED (MODE 1 ONLY)
Lv int 0 5 0 Logfile: 0=Off, 1=ERR, 2=WARN,3=INFO,4=VERBOSE,5=DEBUG
Dv int 0 5 0 DebugView: 0=Off, 1=ERR, 2=WARN,3=INFO,4=VERBOSE,5=DEBUG
Disp int 0 3 1 Display mode, 0=BLENDED(original), 1=EXBLEND, 2= SRESTORE, 3=COMPONENT, (4=ADJACENT Invalid)
DClip clip - - UNSET Denoised Detection Clip, Same colorspace & dimensions as Clip.
CompUB int 0 2 2 Component Unblend Mode for DISP display mode
Decimate bool - - - IGNORED
Decompix int 1 2 1 IGNORED (MODE 2 decimated ONLY)
DecClpIx int <0 255 1 IGNORED (MODE 1 ONLY)
Debug bool false True False Switch On: ERRORS, WARNINGS and DEBUG logging (ie 1,2 and 5)

Mode 1: (ExBlend v1.03+ Scan & Store Data, default, Need to do this before using MODE==2) ------------------

Arg Type Min Max Default Comment

clip clip clip clip NONE YV12 & YUY2 PROGRESSIVE
Pal int 0 1 0 PAL -1 Not Allowed (Error)
LockThresh float 0.0 100.0 1.0 default rarely needs change.
IThresh float 0.0 100.0 3.0 default rarely needs change.
Show int 0 5 5 Metrics (0=OFF,5=FULL)
Exbfile string - - "ExBlend" Project: logs,'Exbfile'.XBD & Decimated (Mode 2) Frames Cmd file.
Ver bool False True False ALL ARGS IGNORED if true
Revip bool False True False Reverse Metrics Direction when show > 1
Override string - - "" Input Override Command file
Lv int 0 5 0 0=Off, 1=ERR, 2=WARN,3=INFO,4=VERBOSE,5=DEBUG (logfile)
Dv int 0 5 0 0=Off, 1=ERR, 2=WARN,3=INFO,4=VERBOSE,5=DEBUG (DebugView)
Disp int 0 3 1 Display mode, 0=BLENDED(original), 1=EXBLEND, 2= SRESTORE, 3=COMPONENT, (4=ADJACENT Invalid)
DClip clip - - UNSET Denoised Detection Clip, Same colorspace & dimensions as Clip.
CompUB int 0 2 2 Component Unblend Mode for DISP display mode
Decimate bool - - - IGNORED (MODE 2 ONLY)
Decompix int 1 2 1 IGNORED (MODE 2 decimated ONLY)
DecClpIx int <0 255 1 Clip index used in eg Exblend_Decimated.Txt, <0 == NONE.
Debug bool false True False Switch On: ERRORS, WARNINGS and DEBUG logging (ie 1,2 and 5)


Mode 2: (Final Output mode, needs MODE 1 pass 1st.) -------------------------------------------------------------

Arg Type Min Max Default Comment

clip clip clip clip NONE YV12 & YUY2 PROGRESSIVE
Pal int - - - Ignored, Set from 'Exbfile'.XBD
LockThresh float - - - Ignored, Set from 'Exbfile'.XBD
IThresh float - - - Ignored, Set from 'Exbfile'.XBD
Show int 0 5 0 Metrics (NON-DECIMATED:0=OFF,5=FULL | DECIMATED:0=OFF,>0 ON) [DEFAULT different to modes 0 & 1]
Exbfile string - - "ExBlend" Project: (logging, Inputs Project Mode 1 XBD file)
Ver bool False True False ALL ARGS IGNORED if true
Revip bool False True False Not used when Decimate (Metrics are different).)
Override string - - - IGNORED, Set in Mode 1
Lv int 0 5 0 0=Off, 1=ERR, 2=WARN,3=INFO,4=VERBOSE,5=DEBUG (logfile)
Dv int 0 5 0 0=Off, 1=ERR, 2=WARN,3=INFO,4=VERBOSE,5=DEBUG (DebugView)
Disp int 0 4 1 If Decimate, 0_BLENDED, 1_EXBLEND, 3_COMPONENT & 4_ADJACENT valid (2_SRESTORE converted to EXBLEND)
DClip clip - - UNSET Usually as Mode 1 (or NONE), Same colorspace as Clip.
CompUB int 0 2 2 Component Unblend Mode for DISP display mode
Decimate bool false True True
Decompix int 1 2 1 Decimated Component Index. Valid if DECIMATE & disp=0_BLENDED/3_COMPONENT/3_ADJACENT else Ignored.
DecClpIx int <0 255 1 IGNORED (MODE 1 ONLY)
Debug bool false True False Switch On: ERRORS, WARNINGS and DEBUG logging (ie 1,2 and 5)

StainlessS
16th February 2012, 15:48
And as the post limit is 16000 chars, here is part 2.




To use ExBlend(), you need to do a scan of the clip first using eg:

ExBlend(clip, Mode=1) # AssumeFPS(250.0)

or

ExBlend(clip, Mode=1,dclip=DCLIP) # AssumeFPS(250.0)

Where DCLIP is a denoised detection clip if required.

Scan through the file and it will create an ExBlend.XBD file for Mode 2 as in below example.

ExblendedClip=ExBlend(clip, Mode=2,dclip=DCLIP)



DISP: (Display Mode)
Controls which frames are returned instead of Blended Frames, using CompUB & Decompix as additional controls.
Non-Blended frames will ALWAYS return frames from source clip.

Where 'S' is Source Clip Frame, 'D' is DCLIP Detection clip frame (if supplied Else 'S')

In 'mode' 0, 1, & 2 (mode 2 when Decimate == False):

0 DISP_BLENDED If (CompUB !=0), Returns blended frame from D, else blended frame from S.
1 DISP_EXBLEND Blended frames are unblended as for CompUB.
2 DISP_SRESTORE 1st Blended frame is unblended as for CompUB, 2nd replaced with frame after 2nd blend.
3 DISP_COMPONENT Blended frames replaced with COMPONENT frame as for CompUB.

In 'mode' 2 with Decimate==True: (only DISP 0, 1,3 and 4 valid)

0 DISP_BLENDED If (CompUB !=0), Returns BLENDED frame from D, else blended frame from S,
further control via Decompix to select 1st or 2nd blend frame of blend pair.
You might want to set CompUB to 0 here to return the original blended source frame and
not from the DClip.
1 DISP_EXBLEND Blended frames are unblended as for CompUB (Same as NOT Decimated).
3 DISP_COMPONENT Returns COMPONENT frame as for CompUB, Decompix==1 = 1st Component frame, 2 =2nd.
4 DISP_ADJACENT Returns source frame 'S' adjacent to Decompix blend index.


CompUB: (Component Unblend Mode)

Unblend-ing is achieved in two stages, firstly, two component frames are recoverd, and then the average
of these two components is used to finally recover the unblended frame. Each of the component frames is
unblended using a blended frame and also the good frame adjacent to the blended frame.
CompUB controls which clips are used in reconstruction of the component frames where both Source clip
and Dclip are provided. If no Dclip is supplied then the source clip is always used (Obviously).

CompUB ranges from 0 to 2, where, (below assumes a Dclip)

0 = No frames of Dclip, both blended And blend adjacent frames comes from source clip.
1 = One Frame comes from Dclip ie the blended frame. The adjacent frame comes from source clip.
2 = Both blended and adjacent frames come from Dclip (Default [experimental, may change]).

An easy way of remembering it is as the number of Dclip frames used in the reconstruction of the Component frames.
(Info:- The Blend detector always uses the Dclip if supplied ie "DDDD").
0 == "SSSS", 1 == "SDDS", 2 == "DDDD", where the two middle letters are the blends and outer are adjacent.


Decompix: (Decimated Component Index)
When Decimate is true, (MODE 2 only) the only valid DISP Display modes are 0_DISP_BLENDED, 1_DISP_EXBLEND, 3_DISP_COMPONENT
and DISP_ADJACENT (only valid in mode==2 and when Decimate==true).

0_DISP_BLENDED, using both CompUB and Decompix, you can pull out the blended frame from either blend index 1 or 2,
and from either the source clip (most usual) or the Dclip if required, using the CompUB arg.
Might be useful to anyone wanting to do their own advanced un-blending in script, using ExBlend() only as the detector.

1 DISP_EXBLEND is the usual disp mode and returns a fully unblended frame for each pair of blends.

3 DISP_COMPONENT, returns the component frame for either blend index 1 or blend index 2 (1st or 2nd blend),
Decompix specifies which of the 2 blend component frames are returned. Can be used to 'pull out' component
frames (1 & 2) from a decimated clip for alternative processing. eg, you could do some kind of denoising on the
component frames before blending them together yourself with eg Merge(). You could then replace your denoised
and merged frames back into the decimated clip, using eg ClipClop() plugin. ExBlend() does no denoising itself.

4 DISP_ADJACENT, returns the source 'S' frame adjacent to the Decompix blend index frame.
Might be useful to anyone wanting to do their own advanced un-blending in script, using ExBlend() only as the detector.

ExbFile: (ExBlend Project File, [default "ExBlend"], Changed function a little in v1.03)
The Exbfile project name is used to create log file names (eg "ExBlend_1.LOG", where '_1' represents the active
MODE at the time).
In MODE 1 only, it is also used to create eg an "ExBlend.XBD" file which totally replaces
any detection stage in MODE 2 and all of the info required to Decimate in Mode 2 is contained in the XBD file.
Mode 1, also creates an eg "ExBlend_Decimated.TXT", which is a command file for use in a range/frame replacement
plugin. [eg ClipClop()], This "ExBlend_Decimated.TXT" is a file containing frame numbers that can be used to select
MODE 2 decimated output blend recovered frames.
In Mode 2, you can choose to not Decimate, in which case it would be as previous versions of ExBlend and require
later Decimation using your favorite Decimator. Or, you can Decimate if you choose, you can process the
Decimated output of ExBlend 1_DISP_EXBLEND using your favorite Motion Compensated denoiser, and feed the original
ExBlend output and the denoised output into ClipClop, using the ExBlend_Decimated.TXT command file to replace the
ExBlend recovered un-blended frames with the denoised ones, and NOT requiring yet another pass. Pass 1 to generate
the XBD and decimated frames file and Pass 2 to unblend, decimate, motion compensated denoise and replace back
into the ExBlended clip again.



DecClpIx: (Decimated Clip Index, MODE 1 Only)
This setting (-ve to 255 [default 1]), sets the clip index used in the MODE==1 creation of (default) "ExBlend_Decimated.Txt"
file. This command file is a command file intended for the ClipClop() frame replacement plugin. For ClipClop(), the format
would be like so:-

"1 666"

Where '1' is the clip index number for the replacement clip, and '666' is the frame to replace.
This could be used like this,

FixedClip = ClipClop(ExblendedClip,DenoisedExblendedClip,CMD="ExBlend_Decimated.Txt")

In the above, 'ExblendedClip' would be clip 0, and 'DenoisedExblendedClip' clip 1, it would replace the cleaned up frames
back into the deblended clip after eg post Exblend recovery denoising (eg MCDegrain).
You could also use the Prune() plugin to view ONLY the unblended Denoised frames, Prune requires clip index's starting at 0
BUT, the below should work OK.

FixedFramesOnlyClip = Prune(FixedClip,FixedClip,CMD="ExBlend_Decimated.Txt")

OR

FixedFramesOnlyClip = Prune(DenoisedExblendedClip,DenoisedExblendedClip,CMD="ExBlend_Decimated.Txt")

without putting them back into the ExblendedClip clip first.


As Prune()'s clips index starts at zero, we used the input clip name twice so we can use clip 1 (2nd FixedClip) to match
the command file.


To view just the ExBlended frames (without denoise) eg:

Prune(ExblendedClip,ExblendedClip,CMD="ExBlend_Decimated.Txt")


To extract the two component clips recovered frames only, and view them side by side

COMPUB=2 # you choose
C1=ExBlend(clip,Mode=2,disp=3,CompUB=COMPUB,Decompix=1)
C2=ExBlend(clip,Mode=2,disp=3,CompUB=COMPUB,Decompix=2)
C1_2=(Prune(C1,C1,CMD="ExBlend_Decimated.Txt")
C2_2=(Prune(C2,C2,CMD="ExBlend_Decimated.Txt")

StackHorizontal(C1_2,C2_2)


To extract the two component recovered frames, denoise them, merge together put back into ExBlended decimated clip.

COMPUB=2 # you choose
C1=ExBlend(clip,Mode=2,disp=3,CompUB=COMPUB,Decompix=1).MCDegrain(3)
C2=ExBlend(clip,Mode=2,disp=3,CompUB=COMPUB,Decompix=2).MCDegrain(3)

#Return StackHorizontal(C1,C2)

Combine = Merge(C1,C2) # Repaired. Average of the two denoised component frame clips.

FixedClip=ClipClop(C1,Combine,CMD="ExBlend_Decimated.Txt")
Above C1 is mistake, C1 is denoised, need a non-denoised intermediary clip instead.


As an alternative to using double clip names in Prune, you can change the default clip index in the "ExBlend_Decimated.Txt" (Decimated Frames file)
so that Prune or some other alternative could be used with another clip index, a -ve "DecClpIx" will miss out the clip index altogether,
but you would then have to use another frame replacement plugin alternative to ClipCLop() (Whose index needs to be 1).

Together, Disp, Decimate, CompUB, Decompix, and eg ExBlend_Decimated.Txt allows ExBlend() to expose both
of the component frames (Decompix) fashioned with the desired CompUB method, after eg Motion compensated
processing, merged together to create the finally recovered frame, this result would then be fed back into
either one of the two ExBlend unblended component clips via ClipClop() and the ExBlend_Decimated.Txt command file.

Advanced scriptors may wish to extract the clips containing the blended frames and adjacent frames for both blend index
1 and blend index 2 and do some clever masking and such to recover the unblended frames themselves.

StainlessS
16th February 2012, 16:01
Here from an example clip courtesy of JohnMeyer from his thread here:-
http://forum.doom9.org/showthread.php?t=162599


https://s20.postimg.cc/jxhxf8wot/Ex_Blend-_Dog.jpg (https://postimg.cc/image/51je7nla1/)

The clip in question is 3:2 pulldown that has been resized as if progressive.

Pic1 is the original, 2nd is a Blur(0,1) used as a Dectection clip,
3rd pic is ExBlend() output, and pic 4 is McDegrained ExBlend output.

ExBlend now outputs a command file for ClipClop() frame/range replacement plugin
so that you can use eg McDegrain on the clip and then pluck out the recovered frames
and put them back into the original clip again.
ExBlend also implements now native decimation, so that step is no longer necessary.
In addition, ExBlend, exposes some of it's inner working so that an advanced scriptor
could perhaps do some real clever deblending that is beyond ExBlend.

There follows a script that actually does the deblending itself, and the McDegrained
output of it is indistinguishable from the McDregrained ExBlend output.
There is a little redundancy in the script but I'll give it as supplied in the new version zip.


# ##########################################################################
# Unblend frames in script, use ExBlend() only for detection and decimation.
# Raw frames extracted from source/Dclip and unblended via script,
# then put back into decimated clip.
#
# Requires mt_MaskTools, MCDegrain, ClipClop() & Prune()
#
# ##########################################################################
Import("MCDegrain.avs")

AVISource("problem video.avi")
Crop(2,0,-2,-0) # VDUB DONT Like 636 width)

DCLIP=Blur(0.0,1.0) # Required as bad combing due to resize on Telecine clip.

#Return Exblend(mode=1,CompUB=2,Dclip=DCLIP) # 1st Pass to create ExBlend.XBD

ADJACENT=4
BLENDED=0
#
ORG=Exblend(mode=2,disp=0,CompUB=0,dclip=DCLIP) # Original combed Clip, Decimated
EXB=ClipClop(ORG,ExBlend(mode=2,CompUB=2,dclip=DCLIP).MCDegrain(3),CMD="ExBlend_Decimated.Txt") # ExBlend clip with denoising
# Above, Decimate=true, is default in Mode 2.
# Decimated clip with Frames Adjacent to Blend index 1 (from Dclip, [CompUB==2])
A1=Exblend(mode=2,disp=ADJACENT,Decimate=true,CompUB=2,dclip=DCLIP,Decompix=1)
# Decimated clip with Frames Blend index 1 (from Dclip, [CompUB==2])
IX1=Exblend(mode=2,disp=BLENDED,Decimate=true,CompUB=2,dclip=DCLIP,Decompix=1)
# Decimated clip with Frames Blend index 2 (from Dclip, [CompUB==2])
IX2=Exblend(mode=2,disp=BLENDED,Decimate=true,CompUB=2,dclip=DCLIP,Decompix=2)
# Decimated clip with Frames Adjacent to Blend index 2 (from Dclip, [CompUB==2])
A2=Exblend(mode=2,disp=ADJACENT,Decimate=true,CompUB=2,dclip=DCLIP,Decompix=2)
###########################################################################
# To recover a blend component frame, we use:
# (IX * 2) - A, ie ((blended_frame * 2) - Adjacent_frame)
#
# For Chroma,
# (((IX - 128) * 2) - (A - 128)) + 128
# IX*2 - (128 *2) - A + 128 + 128
# IX*2 - A - (128 *2) + 128 + 128
# IX*2 - A (ie same as for Luma).
###########################################################################
#Below 2 ClipClops NOT NECESSARY, X & Y same frame in non blended frames, however, including the
# ClipClop's, will be faster as non blended frames taken from A1 instead of mt_lutxy() output.
# As mt_lutxy affects all frames we recover the good non-blended frames from any decimated clip (A1), using ClipClop.
# 1st component unblended frames, (IX1 * 2) - A1
Component1=ClipClop(A1,mt_lutxy(IX1,A1,"x 2 * y -",Y=3, U=3, V=3),"ExBlend_Decimated.Txt")
# 2nd component unblended frames, (IX2 * 2) - A2
Component2=ClipClop(A1,mt_lutxy(IX2,A2,"x 2 * y -",Y=3, U=3, V=3),"ExBlend_Decimated.Txt")
###########################################################################
# Optional Denoise Component clips (Recovering from A1 again as McDegrain changes good frames too)
#Component1=ClipClop(A1,Component1.McDegrain(3),CMD="ExBlend_Decimated.Txt") # Can comment out
#Component2=ClipClop(A1,Component2.McDegrain(3),CMD="ExBlend_Decimated.Txt") # Can comment out

# Blend both component frames together to 'iron out' noise, [Should NOT alter good frames (same frame) ie (Z + Z) / 2 = Z].
Fixed = Merge(Component1,Component2) # (C1 + C2) / 2
###########################################################################
# Optional Denoise completely recovered clip. (Restore good frames again).
Fixed=ClipClop(A1,Fixed.McDegrain(3),CMD="ExBlend_Decimated.Txt") # Can Comment out

FixedFramesOnly = Prune(Fixed ,Fixed ,CMD="ExBlend_Decimated.Txt")
###########################################################################
#Return FixedFramesOnly
#Return Fixed

D=ClipDelta(EXB,Fixed)
TOP=Stackhorizontal(ORG,fixed)
BOT=Stackhorizontal(EXB,D)
return Stackvertical(TOP,BOT)
######################################
# ORIGINAL CLIP | SCRIPT UNBLEND #
# ---------------------------------- #
# EXBLEND DENOISE | Diff EXB-SCRIPT #
######################################

Function ClipDelta(clip clip1,clip clip2,bool "amp",bool "show") {
# Return Clip Difference of input clips (amp==true = Amplified, show==true = show background)
amp=Default(amp,false)
show=Default(show,false)
c2=clip1.levels(128-32,1.0,128+32,128-32,128+32).greyscale()
c1=clip1.subtract(clip2)
c1=(amp)?c1.levels(127,1.0,129,0,255):c1
return (show)?c1.Merge(c2):c1
}



Here @ full size. (Note the FixBlendIVTC version on John's thread has vertical blur applied to all frames
of the output, the above code affects (blur) only the de-blended ones and MCDegrain would have the
effect of sharpening those up again [I think])

https://s20.postimg.cc/5sc4dfnnh/Dog_103b.jpg (https://postimg.cc/image/iwhoq4fp5/)

See new version, on MediaFire via Sig

EDIT:- See also 2 previous posts (exceeded D9 limit post limit).

EDIT: Below links might be useful.
"Problem Video.AVI" (link already included with ExBlend, or get from John's Thread.)
http://www.mediafire.com/?5vaci1oepo3kjb1

ClipClop Plugin.
http://forum.doom9.org/showthread.php?t=162266

Prune Plugin:
http://forum.doom9.org/showthread.php?t=162446

StainlessS
6th January 2013, 20:03
New version ExBlend() v1.03b2, Fixed "decimation=false" output frame rate bug.

See Mediafire in sig.

EDIT: The above expanation is as clear as mud, dont know how better to do it though.

ChiDragon
2nd January 2014, 21:16
This is a very slick filter. It's criminal that this doesn't have more responses! :goodpost:

On my system, the default location for writing "Exbfile" is the Plugin's dir rather than the script dir. This is a problem because it gets written to the VirtualStore and then isn't read back when set to mode=2. (My plugin is located in %PROGRAMFILES(x86)%\AviSynth 2.5\plugins\)

You may want to note in the doc that you can get a much faster Mode 1 scan by setting show=0. Mine went from 230-260 fps to 600-700 fps. :devil:

franketto
16th August 2014, 10:02
StainlessS, I'm trying your ExBlend filter, but I can't make it work.

I have a clip at 30fps with 4NormalFrames and 2FrameBlended, so the original should be a PAL 25fps.
I load this script in VD, play it a little, then close it, but I can't find any written file in C: (I use W7 64bit).


LoadPlugin("Z:\ExBlend\ExBlend.dll") #different dir from Avisynth plugins
FFmpegSource2("myfile.mp4")
Global PAL = 1 # The original frame rate PRIOR to blended frame rate conversion
# 0 = 24 FPS FILM or 23.976 FPS (3 good 2 BAD), 1 = 25 FPS PAL (4 Good 2 BAD), -1 = AUTO PAL Detect

Global ITHRESH = 3.0 # Just so we use same ithresh for UNBLENDED & METRICS (default 3.0)

Global LOCKTHRESH = 1.0 # Experimental lock, 0.0 Off, suggest about 1.0

Global VER=false # Shows version info

SetupExblend(1) # Experiment with PAL THRESH and ITHRESH Settings for ExBlend(), and create DATA FILE in C:\
return Last

Function SetupExBlend(Clip Last, Int Mode){
UNBLENDED = Exblend(Last,Mode=Mode,pal=PAL,lockthresh=LOCKTHRESH,ithresh=ITHRESH,Show=0) # Fixed Clip
METRICS = Exblend(Last,Mode=Mode,pal=PAL,lockthresh=LOCKTHRESH,ithresh=ITHRESH,Show=5,ver=VER) # Just to show Metrics
# Make Windowed display clip
LEFTCLIP =StackVertical(Last,UNBLENDED)
RIGHTCLIP=StackVertical(METRICS,Diff(Last,UNBLENDED))
StackHorizontal(LEFTCLIP,RIGHTCLIP) # Glue them together
# last=METRICS
assumefps(250.0) # For quick scanning using VirtualDubMod
return Last
}


What's wrong?

EDIT:
I searched in all HDs (both C and the others) this:
exbfile*
with no result

franketto
17th August 2014, 17:14
I found it, the error was:

I load this script in VD, play it a little, then close it

You must play all the file up to the end! It doesn't work: stop and move the cursor at the end.
If not, the filter outputs in the console (like DebugView), ie: "ExBlend:- BUFFER INCOMPLETE (5.0)", but normally nobody opens a console to see error messages...
It should be better to note this in the docs.

If you want to test the filter on partial file you must use trim().

Could reducing the original res (only in progressive clips) be another trick to speed up the mode=1? After that in mode=2 restore the original res.
Or this can affect negatively the xbd file?

ChiDragon
17th August 2014, 17:51
Instead of hitting Play, it makes more sense to use Run video analysis pass anyway since then you get the full FPS your CPU is capable of generating rather than having to guess with AssumeFPS. AvsPmod also has an analysis pass option.

StainlessS
17th August 2014, 22:41
Yep, video analysis pass probably best (fastest) in Vdub current, however I mostly use VDubMod which does not have that analysis mode,
also, VD video analysis pass jumps back to frame 0 at conclusion, and I like to see the metrics on last frame.

franketto
18th August 2014, 13:11
Something doesn't work with the previous code:

http://i.imgur.com/sLK9MDwl.png
Img larger:
http://i.imgur.com/sLK9MDw.png

testfile:
https://www.sendspace.com/file/z8474n

StainlessS
18th August 2014, 20:35
ExBlend originally intended for Telecine clips that were scaled down using eg ReduceByTwo(), ie resultant height = 480 / 2 = 240.
It has been used successfully to recover a clip that was resized as if progressive but that was a bit of a kludge (beta version only.
looks like you were using the current non beta).

Your clip is 720p, a long way from 240 in height, any idea how it was converted to 720p, what was the source ?
You may have more success if you try to deblend the source clip, prior to upscaling to 720p. As it stands, ExBlend
is not detecting at all prior to frame 177 of your sample, where it detects I think 3 blend pairs (EDIT Actually 5 pairs) and then end of sample clip.

If you scan your clip (whole clip not just a few frames), and it shows above about 94% blend pairs detected, then is suitable for
ExBlend deblending, otherwise need to find an alternative deblender.
(Not sure, but I think I see triple blends in places [EDIT: Yep, pretty sure some triple blends in there]).

Even setting an override at frame 2 as 1st of blend pair, it fails to lock onto the blend sequence.

franketto
18th August 2014, 22:51
I don't know what it was done on that clip.
I know that film is in DVD, but not a Bluray. So I guess the original res was 720x576.
I guess also it was 25fps, as the double blend follow the 4normal2blended pattern. (it was also a Spain production).
So I think they got a 720x576@25 and upscaled at 1280x720@30fps.

Yes, you're right I was not using your latest, now I tryed but changed little.

I tryed also the plugin FixBlendIVTC, even if it was thought for 3normal2blended pattern.
It seems it does quite well.

BTW OT:
I tried to resize the clip at 720x576 or something similar but you can see the loss of res from 1280x720. Is it normal (as the source shouldn't be 720p)? Maybe they used nnedi3 to upsize and so downsizing to original res losses something?

foxyshadis
18th August 2014, 23:24
FixBlendIVTC is the predecessor of Srestore, btw, so you might get even better results from that. Of course, maybe you won't, it's hard to tell.

StainlessS
19th August 2014, 03:16
SRestore does indeed deblend in cases where ExBlend does not, ExBlend is very targeted to a specific type
of blending, and if not pretty much exactly as targeted for, will fail. Give Srestore a bash.

franketto
19th August 2014, 08:38
I tried Srestore with omode="pp=0" but it can't deblend these double blends.
So the only plugin working is FixBlendIVTC().decimate(cycle=6)

hello_hello
9th October 2014, 07:39
I'm jumping threads from here (http://forum.doom9.org/showthread.php?p=1696201#post1696201), trying to do some unblending. After messing around with srestore and FixBlendIVTC, I've been playing with ExBlend (which I had no idea existed) and so far, it's doing quite a good job. I'm not getting any of the atrefacts I was with the previous two filters. However.....

Well firstly, thanks for sharing ExBlend StainlessS. It's much appreciated.

I have a couple of questions while I'll still trying to get my head around it's different options.
I've run an analysis pass and created a ExBlend.XBD file. Mostly, the result is excellent when running ExBlend in mode 2 without any tweaking. However I've noticed in a couple of places it seems to get it wrong when it comes to which frames are the blended ones. I'm not sure why, but I think maybe the pattern of good/blended frames changes (around a scene change), and it takes a few frames for ExBlend to "catch up". Most of the time even that's no big deal, but I've noticed once or twice it's attempted to unblend a clean frame with not so good a result. Here's an example:

SHOW=5
MODE = 2
COMPUB=0

A=Exblend(show=SHOW,mode=MODE,disp=0,CompUB=COMPUB,Decimate=false)
B=Exblend(show=SHOW,mode=MODE,disp=1,CompUB=COMPUB,Decimate=false)
C=Exblend(show=SHOW,mode=MODE,disp=3,CompUB=COMPUB,Decimate=false)
D=Exblend(show=SHOW,mode=MODE,disp=2,CompUB=COMPUB,Decimate=false)

TOP=StackHorizontal(A,B)
BOT=StackHorizontal(C,D)
StackVertical(TOP,BOT)

http://s28.postimg.org/ys1nhvt8t/Ex_Blend.jpg

I can upload a sample if need be, but it there a way to tweak the detection of blended frames I'm missing, or is the above something you just have to live with? Mind you I'm not complaining. 99.99% of the time it's doing a very good job.

A couple of questions while I'm here:
LockThresh and IThresh. What do they do exactly. If there's a description of their function, I've missed it.

And.....

Think I made a big mistake there in the description for ExBlend().
Now believe that what ExBlend fixes is 3:2 pulldown that has been blend deinterlaced and then vertically downsized to half height. The results are indistinguishable from perfectly blended frames as described for ExBlend(). ExBlend will not touch 3:2 pulldown blend deinterlaced that has NOT been downsized.
Is the above supposed to be true for the current version, or just the original version, because it seems to be doing a good job on my video which hasn't been downsized.

Thanks.

StainlessS
9th October 2014, 08:29
The red marked Percentage in your examples show that ExBlend believes that it is not doing a good job,
(from source, dont remember if I showed colors in doc)

// RED ORANGE YELLOW GREEN WHITE
gud = (percent<90.0)?'2':(percent<92.0)?'A':(percent<95.0)?'6':(percent>97.0)?'C':'*';


Below 90% believes not good(Red), above 97% believes very good(White).
So it looks to me that ExBlend is not the right plug for the job, but if it is the only one that performs well at all then I guess it's the only game in town.

Yes the quote you gave still holds, is intended only for VCD conversions, but has been used with a bit of a kludge to fix the JohnMeyer problem clip earlier
in thread.

You can explore the Override setting given in Settings.txt, here:

string Override Default "", (not set), eg "Override.txt" (New to v1.01)
Filename of file to force manual override the blend detections.
In v1.03, is only used in MODE=1. Neither Mode 0 nor Mode 2
allows a manual override, you must force the override's in mode
1, v1.03 extends the override ability and greatly increases it's effectivness.
Also, logging will assist in setting up the overrides file.

Required command format:-

444=h1
555
666=*4

In the above case, frame 444 is set to HINTED, ie Not A Blend. The number
after the 'h' denotes the hinted count, in this case 1, eg 444=h2 would
set two consecutive hinted frames.

555 will be set to a SHORT BLEND PAIR ie (H12H), frame 555 (in this case) will
be set to blend index 1, 556 to index 2, and the frames before and after the
blend pair to HINTED. NOTE, in this case frame 555 is the 1st BLEND index and
NOT the first hinted frame.

Frame 666=*4 will set an override at frame 666 to 4 LONG BLEND PAIRS. A long
blend is shown (in logs) as (H12HHH) for FILM or (H12HHHH) for PAL. The frame
(in this case 666) is the position of the 1st blend index, it will (on only
the first LONG BLEND PAIR) be preceded by a hint, and the blend pair followed
by 3 or four hints depending upon whether FILM or PAL mode is in effect. As in
above case, '666=*4' would yield a result of (H12HHH12HHH12HHH12HHH) if in
film mode, or (H12HHHH12HHHH12HHHH12HHHH) in PAL.
With metrics shown, the 'M' flag will show where individual manual override 'H'
hints were set, or blend index 1 postions of either short or long blend pair
overrides (in the 666 example, it will flag the positions of all the 1's
within the parenthesis['(' and ')'] ).

ExBlend is intended to correct clips that do not stay in sequence, if you have
a clip that does stay in sequence (and you are sure of that), you can force
ExBlend to stay in sequence too using the manual override command file. If say
the first, 1st blend index is at frame 2, you could create a text file containing
the manual override command:-

2=*1000000

Thats it. (you would also need to set correct pal/film mode and such). Here
we gave a command to set 1 million LONG BLEND PAIR's, it will cease when
it comes to end of clip, and in the logs will tell you how many it actually set.
This excessive repetition count will not be considered an error by the override
command parser, however, trying to start a new command outside of clip range will
be considered an error. Also, NOTE, all manual override commands MUST be in ascending
order of frame number, you are NOT permitted to override previously set overrides,
some sort of order has to be maintained. As an aid (and byproduct of this strict
ordering) the parser can tell you (in logs) where the next permissable command
may be set. If trying to set up a manual override command file, use the logs, they
are your friend when trying to do this.


From Setting.txt

float lockthresh Range 0.0 (Off) to about 2.0, Default 1.0 (No longer considered EXPERIMENTAL, so default 1.0)

The lockthresh arg switches on the locking function of ExBlend().
Purpose being to try and latch on to the sequence when near static scene is encountered.
If the lock is activated, the 'L' Locked flag will be set in metrics.

NoLMN[f]=x.xxxx
L=y.yyyy LMX[f]=z.zzzz

I dont really wanna explain how locking works, it may
change if someone else can implement a better version. However, for locking
to take effect, some pre-conditions have to be satisfied. The frame must
be detected as non-blended, the previous frame should have been hinted, and at
least some of the conditions that would qualify as a blend detection must
be present, so not all frames qualify for the pre-conditions. If a frame does
qualify, then you may see something like L=y.yyyy which would indicate a
locking metric for the current frame, it is this metric that is compared to
LOCKTHRESH, if below or equal, then the frame is locked (converted to a blend
detection). If the frame is locked, the L flag will be set and the metric will
be Hi-lited. Once any frame has been locked, you may see LMX[f]=z.zzzz and
this shows the frame number and lock metric for the frame with the highest
locked metric, yet encountered. There may also be an indication for the frame
with the lowest lock metric that did NOT lock as in NoLMN[f]=x.xxxx
You may want to investigate all of the minimum and maximum flagged frames
both for locking and Ignore functions. Any frame that qualifies and would pass
the locking criteria will fail silently if the merge delta is above the
ithresh Ignore setting, it will not appear or be counted as an ignored frame.

If anyone would like to improve the functionality of lock, then please
be my guest.
This filter outputs a list of LOCKED frames which can be viewed using DebugView,
or may be output to a logging file.

v1.02, can now use eg 'disp=0' to view original blended clip along with metrics to
view frames flagged for investigation for either locking or ignore.


float ithresh 0.0 to 100.0, Default 3.0

There was a weird transition in the
original clip that prompted this filter to be written, it resulted in an even
more weird effect after unblending (looked sort of embossed). This is an
attempt to avoid future similar problems, but I dont have the original problem
video any more so cant really test it, also, the detection logic has changed
a little and so the it may no longer be a problem.
If merge Delta (MD) for a detected blend pair goes above this number, then the
blends will be ignored. I suppose that you could cut down on the number of false
blend detections by lowering this but it probably does not need it,
it works fairly well as it is. If MD exceeds ithresh, the 'I' Ignored flag will
be set and the detected blended pair will be ignored, and a little futher info
will be given when show=5. If there were any IGNORED blends, then it may be a good
idea to take a look at the offending frames both with ithresh at its setting
of 3.0 and with ithresh set to eg 100.0 where the suspect blend will not be ignored.

Written since above, the ithresh setting does seem to work quite well and it's
default setting of 3.0 may cut down on false detections but may IGNORE good blend
detections too, this is conservatively set so as not to allow any bad ones
through. A clip has been observed that went out of sequence every few minutes by
throwing in a triple blend, this ithresh setting seems to avoid the unpleasant
effects of bad detections at these points. You may need to raise this if many
IGNORED blends occur, perhaps in 'not so good clips'.
This filter outputs a list of IGNORED frames which can be viewed using DebugView,
or may be output to a logging file.

v1.02, can now use eg 'disp=0' to view original blended clip along with metrics to
view frames flagged for investigation for either locking or ignore.

hello_hello
10th October 2014, 02:36
Thanks for the info. I'd spent so much time trying different settings and reading info in this thread I forgot about the settings.txt file in the end.

Despite the red marked percentage in my examples, ExBlend has been doing quite a good job most of the time. If I move forward a little in the video and let it run, it settles down to a fairly consistent 96% or more.

I'm still playing around a little, but I've found a few sections of video which causes ExBlend to produce a kind of "embossed" look, as mentioned under the ithresh section in the settings file. Changing the ithresh value seems to fix it, but it seems to fix it at the expense of unblending blended frames. I can upload a sample of video if you want to have a look, but maybe it's simply because I'm using ExBlend on video it wasn't designed for. It's a pity though, because aside from a few frames here and there which end up looking "embossed" it's doing a very good job.

http://s24.postimg.org/3o0hp9iqd/embossed.jpg

Anyway, as I said, I'm still playing around. I've gone back to FixBlendIVTC for the moment.
The artefacts I'm getting with srestore and ExBlend are 100% repeatable and I thought the same applied to FixBlendIVTC, but I discovered I could run FixBlendIVTC for a period (in a script in MeGUI's preview) without seeing any artefacts, but when I step back a few frames they appear. I don't know why, but at the moment I'm trying FixBlendIVTC on a couple of videos from start to finish to see what happens. Hopefully it'll do the job, because it's unbelievably slow.

StainlessS
10th October 2014, 09:18
96% is pretty good, when given an appropriate clip, normally produces in the region of 97% -> 98.5% (occasionally 99%->100%).
Dont bother with the sample, my 4G Mifi thing is busted, and the shop has ordered another but I may have to wait up to two weeks
for it, on 3G 3 Mobile broadband now and my signal has been terrible for about 2.5 years on that so I'm struggling at the moment to keep
connected (I live next to a big common and I think 3 moved the access point so as not to cover green area, so my brilliant signal turned
to poo-poo overnight and has been same ever since, 4G signal also poo-poo but is infinitely better than 3G and good speed despite the
bad signal [0-1 bars]).
Good luck with FixBlendIVTC.

StainlessS
18th December 2018, 22:57
ExBlend new version, v1.04,

Unfortunately, VBulletin forum does not allow old thread title change so have opened new thread here:- https://forum.doom9.org/showthread.php?t=175948

Moderator, please close this thread.