Log in

View Full Version : ExBlend deblender - v1.04 - 18 Dec 2018


Pages : 1 [2] 3

Drommer
6th August 2023, 22:04
I have a video with a 29.97fps obtained using Telecine and already transcoded using progressive scan. The source material was not 24fps, but 25fps. That is using a sequence of 4 true frames and 2 mixed frames. The sequence of frames is constant throughout the video.

I tried using ExBlend plugin with PAL=1 flag. It generally does what I need, but automatic detection of mixed frames doesn't always work correctly. Sometimes the plugin falsely detects a 3/2 or 5/2 sequence probably because of poor video quality. Trying to change the values of some parameters and not getting the desired result, two questions arose:

1. Is it possible to hard specify the sequence 4/2? That out of every 6 frames of video the last two are always processed as mixed and no other frames are processed.
2. I noticed that deblended frames are visually different. They have more saturation and sharpness which makes them stand out a lot against the real frames. Is it possible any post-processing?

Thank you!

StainlessS
7th August 2023, 18:19
In Mode=1,
Set PAL=1.
Also, see "Override", https://forum.doom9.org/showthread.php?p=1860486#post1860486

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.

Where above 2 [2=*1000000] is frame number of 1st frame of a blended pair.

2)
In old Exblend thread, there is a demo to show how is possible to process blended frames manually outside of Exblend,
the demo uses a vertically blurred DCLip which you probably do not need.
Anyway, can you at least have a play with it to see if you can figure out how to do it, I'm in pain with broken/dislocated ankle,
and not in best mood nor able to think very straight [I'm on 6 different drugs, x number of times per day].
Thanks. [get back if problems and I'll try to assist as best I can].
https://forum.doom9.org/showthread.php?p=1558846#post1558846
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

johnmeyer
7th August 2023, 19:06
Hah, I saw those stills in StainlessS' post and thought the OP was also working on 1971 Stanford campus protests. I then saw my name ...

I'd be happy to look at a clip of what the person is trying to fix, if one is available.

StainlessS
7th August 2023, 19:42
2. I noticed that deblended frames are visually different. They have more saturation and sharpness which makes them stand out a lot against the real frames. Is it possible any post-processing?
That post shows how to manually post process just the ex-blended result frames.

flossy_cake
25th September 2023, 19:23
Thanks a lot for this filter! I am surprised to find it is even possible to do this in theory.

I am using it on this VHS transfer (https://archive.org/download/video_archive_553-cd-207/Weeds%20%281987%29%20VHSRip.mp4) which looks like it was converted from 30i hard telecine to 30p using field blend deinterlacing, and ExBlend repairs it nicely and in realtime too (mode=0).

Strangely it seems to work better and produce less "embossed" frames with lockthresh and ithresh both set to 100.0. I don't really know if I should be doing that or if it would create problems with other clips. I will need to gain some more experience with using it on various clips.

For good frame pacing in mode 0 I seem to need to put in its own thread and preroll some frames, but that's probably specific to my system.

Anyway the panning shot at 5:48 and 13:55 the actor's face are showing better results for me with those thresh settings set to 100.0 if that is of any interest to you.

My script looks like this


# source

LWLibavVideoSource(source="Weeds (1987) VHSRip.mp4", stream_index=-1)

# fix blended frames

ExBlend(mode=0, show=0, lockthresh=100.0, ithresh=100.0).Prefetch(1).Preroll(8)
TDecimate(mode=1, CycleR=1, Cycle=5).Prefetch(1)

# smoothing

QTGMC(InputType=2, TR2=3, EdiThreads=2).Prefetch(4)

# fix black level

blackLevel = -24.0
whiteLevel = 255.0/(255.0+blackLevel)

z_ConvertFormat(
\ pixel_type="RGBP8",
\ colorspace_op="601:601:170m:limited=>rgb:601:170m:limited",
\ dither_type="ordered").Prefetch(1)

RGBAdjust(
\ rb=blackLevel, bb=blackLevel, gb=blackLevel,
\ r=whiteLevel, g=whiteLevel, b=whiteLevel,
\ dither=true).Prefetch(1)

z_ConvertFormat(
\ pixel_type="YV12",
\ colorspace_op="rgb:601:170m:limited=>601:601:170m:limited",
\ dither_type="ordered").Prefetch(1)

StainlessS
25th September 2023, 19:57
Sorry, cant get to it just yet, am messing with hardware and stuff, also
just tried and Avisynth aint working proper.

Note, LSMashVideoSource is designed for mp4 container, does not need indexing and usually rock solid.

I did down the mp4, I note, "Score by Angelo Badalamenti", the same guy who did Twin Peaks (also Blue Velvet and Mulholland drive, apparently).

I'll havva look when I can.

flossy_cake
26th September 2023, 04:25
What a coincidence, I just saw Mulholland Drive last week and had read about that composer. The first thing that struck me about Weeds is how unusually good the soundtrack is. The VHS audio quality is strangely appealing with its wow and flutter. Strange that Nolte would make such an obscure little amateur film after the success of 48hrs.

StainlessS
26th September 2023, 12:48
Posted elsewhere onsite

@ Wonkey_Donkey
Penny Mordaunt, Yay oder Nay:- https://www.youtube.com/watch?v=t5DBdeTrgr4

(The Eyes to the left and the Nose to the right. < cryptic :) >)

EDIT: And Endless Loop <could watch it all day>:- https://www.youtube.com/watch?v=tSiplbYDHCU

kedautinh12
4th October 2023, 07:44
Hi, try your plugin, the result is good but I got wrong some frames, and I've no idea how to fix them, Do you have any suggestion values and parameters of Exblend to fix them???
Script:
QTGMC(Preset="Very Slow", Sharpness=0).SelectEven()
ORG=Last

TMP=ORG
TMP.Exblend(mode=1, ExBfile=".\Exbfile", debug=true, lv=5, dv=5)
RT_ForceProcess() # Force PASS1
TMP=0 # Force Close ExBlend I/P clip [and so also destroy ExBlend Filter clip]. XBD file NOT written until ExBlend destructor is called.

ORG
Exblend(mode=2,ExBfile=".\Exbfile") # PASS2

Return last
Video: https://www.youtube.com/watch?v=TiFWmEEwbmM

Frame 371
https://i.imgur.com/FyMltRP.png

Frame 375
https://i.imgur.com/cSZRMop.png

Frame 387
https://i.imgur.com/aZFq82I.png

Frame 395
https://i.imgur.com/4NKhQKE.png

Frame 399
https://i.imgur.com/e1hUZic.png

flossy_cake
9th October 2023, 03:07
Hi, try your plugin, the result is good but I got wrong some frames, and I've no idea how to fix them, Do you have any suggestion values and parameters of Exblend to fix them???
Video: https://www.youtube.com/watch?v=TiFWmEEwbmM


The field structure appears damaged due to resizing... this is what a field looks like according to SeparateFields():

https://i.ibb.co/7CbW8QD/debug-avs-snapshot-00-36-069.png

So not even QTGMC deinterlacing will be able to produce clean progressive frames for ExBlend to work with, which is probably making it difficult for ExBlend to do its subtraction thing to pull out a clean unblended frame.

The best I could manage was this:


# reduce field structure problem

nnedi3(field=-2).Prefetch(1)
Merge(SelectEven(), SelectOdd()).Prefetch(1)

# deblend to 24fps

ExBlend(mode=0, show=0, lockthresh=100.0, ithresh=100.0).Prefetch(1).Preroll(8)
TDecimate(mode=1, CycleR=1, Cycle=5).Prefetch(1)

# final smoothing & sharpening

QTGMC(InputType=0, preset="slow", TR2=1, FPSDivisor=2, EdiThreads=2).Prefetch(4) # to keep more resolution: InputType=2, FPSDivisor=1



Result: https://drive.google.com/file/d/1mzMobt5uyulSjwKREh9E5Sp1YtBlsp-8/view?usp=sharing

There are still issues like on this sequence "embossed" frames and stutter:

https://i.ibb.co/BGT0jw7/debug-avs-snapshot-01-02-521.png

Perhaps you will get a better result using the prepass mode 1&2 -- I'll have a play around with that later.

edit: tried it just now like your code example with mode1 followed by mode2 and got the same result as mode0 on those problematic sequences.

Am I correct in hypothesising that the issue with embossed frames & stutter is occurring due to the source clip having cadence breaks in the GGGBBGGGBBGGGBB pattern causing deblend to subtract the wrong frame pair?

kedautinh12
9th October 2023, 06:49
Thanks for your help, I think I need to add Denoiser to smooth some scenes:
TemporalDegrain2(postFFT=4, fftThreads=2, devId=1)
https://i.imgur.com/SURCkN4.png

StainlessS
9th October 2023, 11:22
Sorry guys for not getting back to either of you. :(

About my broken/dislocated ankle,
it is recently much more swollen than it was a few weeks ago,
I suspect that they may be going to cut me open again for a 3rd time,
maybe the screws securing titanium plates have come loose or something.
Anyways, I've been doing [EDIT: almost] nothing since the swelling, except watching youtube videos,
I just feel somewhat pissed off and dejected, I aint much touched avisynth related stuff for several
months, and dont feel in any mood to do so any time soon. (hospital appointment on Friday coming,
where I may learn if I'm gonna be sliced open again).

Again sorry.

EDIT: Some youtube distractions,
GilstrapTV:- https://www.youtube.com/@gilstrap/videos
Texas Bushman:- https://www.youtube.com/@TexasBUSHMAN/videos
Anatoly:- https://www.youtube.com/@vladimirfitness/videos

EDIT:- Crazy Japanese Dinosaur Prank:- https://www.youtube.com/watch?v=0Vw4hXg2kIo
Jurassic Carpark:- https://www.youtube.com/watch?v=Ul26r2rbhE4
World's Scariest Pranks:- https://www.youtube.com/watch?v=vSidTZlSbzY

EDIT: Scary Magical Box Prank (Halloween special :) ):- https://www.youtube.com/watch?v=8yU_dQ_fRVs

kedautinh12
9th October 2023, 11:45
Don't worry, Take your care. Get well soon :D

flossy_cake
10th October 2023, 02:37
About my broken/dislocated ankle,
it is recently much more swollen than it was a few weeks ago,
I suspect that they may be going to cut me open again for a 3rd time,
maybe the screws securing titanium plates have come loose or something.
Anyways, I've been doing [EDIT: almost] nothing since the swelling, except watching youtube videos,
I just feel somewhat pissed off and dejected, I aint much touched avisynth related stuff for several
months, and dont feel in any mood to do so any time soon. (hospital appointment on Friday coming,
where I may learn if I'm gonna be sliced open again).


I find that sitting is really bad for circulation to the feet and prolongs my foot injury healing times by weeks.

So if you are spending a lot of hours watching youtube in a seated position, try keeping your feet elevated on a foot stool.

When sitting for extended periods, have a look at the veins on the top of your feet, if they are bulging or the skin colour is slightly purplish then there is inadequate egress flow. On the other hand if your feet are pale and white then its an ingress problem.

I saw a vascular specialist recently who said that blood pressure at the ankles is almost nonexistent for most people and it's actually the muscle contractions when you walk that pumps the blood to and from the feet. And the blood flow is what nourishes the cells with nutrients needed to heal. There are also foods like beetroot and rocket leaves which are vasodilators and can help too.

StainlessS
10th October 2023, 10:55
Cheers for that Flossy.

About every 3 or so hours I have a half hour on the bed (so raising foot, and reduced feeling of pressure, keeping elevated, a good idea).

Swelling seems to be going down quite a bit (since wearing "The-Boot" thingy for about 5 days indoors, and no outdoor walking).
I've also put an elastic tube bandage thingy back on, been off for about 10 days, perhaps helped reduce swelling.

I'll try get beetroot, next time I'm out of the house.

tormento
10th October 2023, 23:51
it is recently much more swollen than it was a few weeks ago
If you have a nearby pool, walk in the water, at least to your hip, for how much as you can, at least every other day.

If you dive (I mean, scuba diving), even better.

I have health issues too, water relieves many.

StainlessS
11th October 2023, 10:42
walk in the water
Well last time I saw the doc, I was told [if possible] to avoid getting the surgical wound wet.
(faster wound healing, & avoid possible infection [already had 1 possible infection scare, sorted with antibiotics]).

EDIT:
I think what was the greatest worry was if infection got 'inside' between titanium plates, where they would have to be removed,
and then the infection cured, and then plates returned again (ie two more surgical operations at least).

Boulder
11th October 2023, 11:04
Well last time I saw the doc, I was told [if possible] to avoid getting the surgical wound wet.
(faster wound healing, & avoid possible infection [already had 1 possible infection scare, sorted with antibiotics]).

EDIT:
I think what was the greatest worry was if infection got 'inside' between titanium plates, where they would have to be removed,
and then the infection cured, and then plates returned again (ie two more surgical operations at least).

Do you have any of this stuff in the UK? Works wonders on all sorts of nasty wounds, also bigger ones. Pine or spruce resin is something my grandma would have used during the WWII days and it never gets old (she did).

https://www.repolar.com/abilar-10-resin-salve/

StainlessS
11th October 2023, 22:46
Cant say that I've seen that stuff, however,
when I was 15 Y.O. at school (about 53 years ago), a lad had something called 'liquid skin' (or similar),
was either 'paint-on' or 'spray-on', but it may have prevented good contact with air/oxygen
which would have hindered healing a bit. (although I think it reduced scalds/burns pain at cost of healing time).

The surgical scar is about 7 inches in length, slightly outside center of back of leg, from heel upwards.
+ two holes where they had a 12 inch screwdriver pushed through my foot (crosswise beneath both knobbly ankle bones),
and for some reason another hole on arch (top) of foot, probably an aid in positioning titanium plates, or something [EDIT: maybe access hole for tightening screws].

The two holes where they hammered in two six inch StainlessS steel nails into shin, are fully healed,
but with weird dents where they were, and with slightly unsettling crosses of scar tissue where the surgeon
made incision in skin prior to hammering in the nails.
The screwdriver and nails were anchor points and part of an 'external fixator' contraption [structure made with a sort of mechano set],
that was in-situ for several days before the 2nd operation.

EDIT: Maybe 'liquid skin' was actually 'plastic skin'.

EDIT: Something [but not exactly] like this [previousy posted]
https://i.postimg.cc/yYt92vG4/44-P010-i250-00.jpg (https://postimages.org/)
Rod marked as 'cancaneal pin' was an actual 12->14 inch screwdriver, really :eek:
I did not have the 'metatarsal pin' in mine as pictured above, and mine was a lot wider,
with mechano set stuff instead of what looks like metal rods above.

StainlessS
5th November 2023, 10:14
Anyways, I did not have to have another operation, foot still swelling but maybe gets better one day.

Thought I'de point to a few open source youtube viewers on github, maybe there are better ones.

FreeTube: W10 YouTube client: https://github.com/FreeTubeApp/FreeTube

LibreTube: Android YouTube client: https://github.com/libre-tube/LibreTube
NewPipe: Android YouTube client: https://github.com/TeamNewPipe/NewPipe/releases

kedautinh12
5th November 2023, 10:45
YouTube revanced is good too
https://t.me/ReVanced_MMT
Github: https://github.com/inotia00/revanced-patches
https://github.com/inotia00/rvx-builder
https://github.com/inotia00/revanced-integrations
https://github.com/inotia00/revanced-manager

StainlessS
5th November 2023, 11:28
I got the Manager APK thing (installs on my 8" Samsung Galaxy Tab S7 Lite, but not 10" Samsung Galaxy Tab A (2019)[instruction set: 64-bit ARMv8a(32-bit Mode)])
But, any way to download the other thing [Revanced_MMT] without Telegram install ? [dont know what it is and dont want to]

kedautinh12
5th November 2023, 13:09
Telegram is chatbox like Discord

johnmeyer
5th November 2023, 17:45
StainlessS, if you're looking for something interesting to watch on YouTube, using your newly-downloaded viewer, given that you are a guy who actually remembers the 60s, you might get a kick out of this:

25 or 6 to 4 – Chicago (Leonid & Friends сover) (https://www.youtube.com/watch?v=9_torOTK5qc)

It is a group of Russians and Ukrainians who have amazing musical skills and have a love of late 60s and early 70s rock bands who featured brass instruments. They have really caught on and have been touring Europe and the USA the past year. I was going to see them when they came to the San Francisco Bay Area next week, but every last seat is sold out.

The guitar player, drummer, and lead singer in this clip are just amazing. In some of their other videos they feature a woman who is not only an amazing singer, but also drop-dead gorgeous. Great combination!

Best of luck on your recovery. I know a guy who has had both knees, both hips, and both shoulders replaced (one hip has been re-done three times!). He has had some pretty long recovery times, but he has eventually always made it through, and is able to play golf several times a week.

You'll make it!

StainlessS
6th November 2023, 03:20
Woah!,
did not know that the homunculus Johnny Galecki (https://en.wikipedia.org/wiki/Johnny_Galecki),
is Ruski, thought he was Belgian.
I was never a big fan of Chicago, but they are pretty darn good, big sound.

But, here one helluva good sound [3rd Street Promenade, Santa Monica, probably the only reason that I'de like to visit the big country],
(three consecutive tunes from the same performance)
https://www.youtube.com/watch?v=Q4HT6AU09CI
https://www.youtube.com/watch?v=-OEr9UYqn2Q
https://www.youtube.com/watch?v=ji6pGc4XRok
And with Ray Chen, one of the world top violinists:- https://www.youtube.com/watch?v=AsIz1xCRQz0

This Ukrainians channel on U tube:- https://www.youtube.com/@KarolinaProtsenkoViolin/videos
Fabulous.

Just got a pair of these (mens slippers, could wear them outside I think) for my dodgy foot (yesterday), quite comfortable.
https://www.primark.com/en-gb/p/faux-fur-slippers-tan-991077657612

I'de quite like to have a full body transplant, then and if that works out OK, a head replacement also.

EDIT: Amazing kid (Seol YoEun, was Wolfgang Amadeus ever this good ?), https://www.youtube.com/watch?v=uuItONGdPjQ
Humoresque (Suzuki Violin 3):- https://www.youtube.com/watch?v=Xf29NXOFcOw
Concert:- https://www.youtube.com/watch?v=QGq5LSfJGPU
EDIT: A reaction video, (cant find the the original):- https://www.youtube.com/watch?v=4LGiZf_M9Pc
Genius 5 Y.O. https://www.youtube.com/watch?v=tn_oLQiSbjc

A bit more Paganini,
https://www.youtube.com/watch?v=POe9SOEKotk
https://www.youtube.com/watch?v=2S24-y0Ij3Y

Roman Kim, Niccolò Paganini mark 2:- https://www.youtube.com/watch?v=KsxY3WL1cP8
This Violinist is NOT HUMAN?? (Reaction):- https://www.youtube.com/watch?v=S4oZZ-4MdlY

Unbelievable, Dimash (SOS):- https://www.youtube.com/watch?v=AUARjexCTlQ
Vocal Coach Reacts (1st time) to DIMASH:- https://www.youtube.com/watch?v=Xiq7KYw8VgM

Heart - Stairway to Heaven Led Zeppelin - Kennedy Center Honors HD(Tribute to Led Zeppelin):- https://www.youtube.com/watch?v=2cZ_EFAmj08
Drummer in above clip is John Bonham's son, his father was Robert Plants best friend,
Hearing Led Zeppelin Stairway to Heaven For the First Time(reaction, she does not say much, too dumb struck):- https://www.youtube.com/watch?v=SNs6BvR3d8E

johnmeyer
6th November 2023, 06:22
I've given that Kennedy Center "Stairway" link to dozens of people. The surviving Zeppelin band members' reactions, starting with the introduction of Bonham's son, and then continuing as the stage keeps expanding with more performers, is as amazing as the performance itself. If you've ever read the background on what they wanted to do when they wrote it, they wanted it to get bigger and bigger. The people who produced the tribute realized that dream.

flossy_cake
23rd November 2023, 04:24
Just thought I would share this setting which seems to help reduce stutters/artefacts for GGGBBGGGBBGGGBB clips

ExBlend(mode=0, lockthresh=0.0, ithresh=100.0, show=0).Prefetch(1).Preroll(8)
TDecimate(mode=1, CycleR=1, Cycle=5).Prefetch(1)
ChangeFPS(60000,1001)

I don't know why but those lockthresh & ithresh settings seem to make it respond more quickly to cadence breaks which NTSC telecine seems to be plagued with.

Outputting the repaired 24 as 60 seems to helps smooth it over a little bit more by making it a 3:2 cadence so that if you do get a small stutter it kind of hides it within the 3:2 judder a bit.

flossy_cake
23rd November 2023, 23:28
Case study: Mad About You DVD Region 1 by Mill Creek Entertainment (https://www.amazon.com.au/Mad-About-You-Paul-Reiser/dp/B01CIS85YE)

Mill Creek strikes again!

If you read Amazon DVD reviews you may be aware that Mill Creek is a DVD publisher which likes making crappy releases in degraded picture quality. In this particular release their DVD authoring team seems to have taken the hard telecined 480i30 frames and just zoomed them in slightly (possibly to hide edge junk) and in doing so have corrupted the field alignment. So 2 in 5 frames are still combed but it's slightly zoomed in combing which makes it impossible to IVTC or deinterlace. Even bob() or separatefields() won't work since random pixels above/below may or may not contain different temporal data depending on whether or not that line happened to contain scaled pixels from the other field due to the zoom. Basically they have given it the touch of death - here (https://drive.google.com/file/d/1AXernIFPQvULtT-rtYqdep2yNqJ1bYKF/view?usp=sharing) is a remuxed sample.

ExBlend to the rescue...


# source
LWLibavVideoSource("c:\original.mkv", repeat=true)

# blur fields together to convert combing into frameblending, i.e what ExBlend specialises in reverse engineering
vinverse(sstr=0.25)

# ExBlend back to 24p
ExBlend(mode=0, lockthresh=0.0, show=0).Prefetch(1).Preroll(8)
TDecimate(mode=1, CycleR=1, Cycle=5).Prefetch(1)

# QTGMC progressive repair mode 1
QTGMC(preset="slow", inputtype=1, rep0=13, FPSDivisor=1).Prefetch(6)

# aspect
Spline36Resize(720, 540)

# optional - convert to 3:2 to hide some ExBlend stutter on cadence breaks
# ChangeFPS(60000,1001)


Result (https://drive.google.com/file/d/11zc9yAYAAHt_nmx2t0-F8e0h6eRYgf-6/view?usp=sharing)

A substantial improvement. Not great, but not entirely unwatchable. There are some cadence breaks where you can see it momentarily stutter (I left it as 24 instead of 60). I might not throw these discs in the trash where they belong, after all, thanks to ExBlend.

:thanks:

StainlessS
24th November 2023, 17:21
ExBlend was my 1st plug for Avsisynth, and the reason I joined D9 was to provide it for users.
Glad that you're finding some additional use for it.

flossy_cake
25th November 2023, 01:25
ExBlend was my 1st plug for Avsisynth, and the reason I joined D9 was to provide it for users.
Glad that you're finding some additional use for it.

Well honestly I really am grateful for it. I don't think I would bother watching much content with 2 in 5 blended frames, it just looks so damn ugly with the blending blur and the stutter.

I've been working on my first Avisynth script for the last 6 months, just doing the final testing on it. It's basically an "adaptive IVTC" script that adaptively switches between TIVTC and BWDIF depending on the field cadence. Has a whole latching and learning system kind of like ExBlend would have as well. I went a bit nuts and put in around 100 threshold parameters for latching and learning, using multiple thresholds elevating to higher lock levels, dynamic cthresh & MI depending on scene motion. I'm trying to make it as user friendly as possible with presets like qtgmc, eg. 50% film, 65% film, 80% film etc. and it will automatically set those 100 threshold params to optimise. Made some animation presets too to handle all the duplicate frames in animation cadences like 8:7, 6:4, 5:5, 4:4 etc.

kedautinh12
25th November 2023, 01:46
Thank Stainroid for create a very good plugin and waiting for a new script from flossy_cake :D

flossy_cake
25th November 2023, 04:38
Thank Stainroid for create a very good plugin

Stainroid?!

kedautinh12
25th November 2023, 05:15
He's like chatGPT for avisynth :D

flossy_cake
27th November 2023, 00:36
He's like chatGPT for avisynth :D

Oh you mean StainDROID as in android. StainROID on the other hand sounds like roid stain which is something else :eek:

Case study: Mad About You DVD Region 1 by Mill Creek Entertainment (https://www.amazon.com.au/Mad-About-You-Paul-Reiser/dp/B01CIS85YE)
Mill Creek strikes again!
ExBlend to the rescue...


In case anyone benefits from it I've manually inspected all 164 episodes to compile a list of which ones need repairing and here is that list...

Season 1&2
No defects, can be TIVTC'd as usual with optional decombing

Season 3&4
Repair with ExBlend:
ExBlend(mode=0, lockthresh=0.0, ithresh=3.0, show=0).Prefetch(1).Preroll(8)
TDecimate(mode=1, CycleR=1, Cycle=5, denoise=true).Prefetch(1)
QTGMC(InputType=1, preset="slow", Rep0=13, Sharpness=0.0).Prefetch(4)
Spline36Resize(720, 540)
ChangeFPS(60000,1001)

Season 5 E01-E12
Only needs TDecimate from 30 to 24 with optional decombing

Season 5 E13-E24
Repair with vinverse + ExBlend:
vinverse(sstr=0.25).Prefetch(1)
ExBlend(mode=0, lockthresh=0.0, ithresh=3.0, show=0).Prefetch(1).Preroll(8)
TDecimate(mode=1, CycleR=1, Cycle=5, denoise=true).Prefetch(1)
QTGMC(InputType=1, preset="slow", Rep0=13, Sharpness=0.0).Prefetch(4)
Spline36Resize(720, 540)
ChangeFPS(60000,1001)

Season 6 E01-E12
Same as season 3&4

Season 6 E13-E26
Same as season 1&2, except E18 same as S05E13-E24

Season 7 E01-E05, E07, E15
Same as season 1&2

Season 7 E06, E08-E14, E16-E22
Same as season 3&4

edit: reduced QTGMC sharpness from default 1.0 to 0.0 as this show has
lots of baked-in sharpening which seems to be interacting with QTGMC's
sharpener to make it look more sharp than usual.



What a disgusting mess made by Mill Creek Entertainment, and what an incredible feat of reverse engineering to salvage it. Is Mill Creek enshittification (https://en.wikipedia.org/wiki/Enshittification)?

flossy_cake
4th March 2024, 00:21
int pal -1, 0, 1 , Default 0, lets Exblend() know what the original frame rate was.

1, Forced PAL 25 FPS original frame rate. If the original source was 24 FPS and PAL is set
to 1, then this can DRAMATICALLY reduce the effectiveness of ExBlend() due to it hinting
out blends and overriding what should have been a blend detection. This will again, throw
it out of sync.


I was just wondering about the pal=1 setting - does this recover 24p from a 25p video, or does it recover 25p from a 30p video?

:thanks:

StainlessS
4th March 2024, 15:03
This one.
I was just wondering about the pal=1 setting - does this recover 24p from a 25p video, or does it recover 25p from a 30p video?
NTSC 720x480, DVD stuff where 23.976 film (progressive) has repeat fields inserted to bring it up to 29.97 FPS,
sometimes this 'stuff' was width-cropped 704x480 and downsized to 352x240 causing sequences of 3 good frames / 2 Blended frames, @ 29.97.
At the time of writing, I did not 100% know the cause of the 3 good / 2 blended sequences that ExBlend fixes,
so I just added the PAL option to attempt fix sequences of 4 good / 2 blend sequences.
I aint ever found any 4 good 2 bad sequences that Exblend fixes.

From docs

3:2 pulldown that has been resized as if progressive

So maybe PAL=1 mode would be 4:2 pulldown (dont know if such a thing exists), and resized as if progressive.


int pal -1, 0, 1 , Default 0, lets Exblend() know what the original frame rate was.

This sets the filters hints, after a blended pair is found, the detector will preset
3 (23.976/24 FPS) frames either side of the pair to HINTED meaning No Blend. If 'pal' (25 FPS)
is set to 1, it will preset 4 frames either side to HINTED. This helps it fall
into sync with sequence but may have slight delayed detection if the sequence goes
out of sync. If a frame has already been preset (visited) then the hint will not
be set, this allows hints to work when scanning both forward and backwards.
Not sure if PAL is actually useful or not, never seen any clip that exhibited this
problem with a good/blended signature of GGGGBBGGGGBBGGGG etc, where there are 4
good frames and 2 blends. As it did not add much difficulty to the plugin, PAL was
implemented just incase it was ever found to be useful.

-1 AutoPal mode. (MODE 0 ONLY)
If you are not sure what the original source was you can set PAL = -1 (MODE 0 Only).
If "Unblended:Blended Pairs" Ratio is between (4.0-0.01) and 5.0 at frame 1500 (1500=60*25
= 60 seconds @ 25 FPS), it will auto switch to PAL hints, the first 60 seconds
could contain the odd extra false blend pair detection.
If AUTO PAL is activated, the Metrics P (PAL) flag is hi-lited. It's
not a good idea to rely on this auto pal switch, you should set pal=1 when you
see it in orange. If autopal is activated and you later see the ratio rise above
5.0, then it would seem that the autopal detection was in error, this can happen
if the 1st 60 seconds contains a lot of static scenes with little movement, in this
case you should change to PAL=0 to disable the autopal detection and force it
to 23/24FPS original frame rate. Again, if the 1st 60 seconds contains a lot of static
scenes and it was originally PAL 25 FPS then the autopal may fail to detect and not
auto switch to PAL mode, in this case, ratio will later fall to above 4.0 and below
about 5.0. In this case you should change to PAL=1 to force PAL mode.

0, Forced 24 (or 23.976) FPS original frame rate (Default).
If the original source was 25 FPS and PAL is set
to 0, then this can reduce the effectiveness of ExBlend() due to it erroneously
detecting false blends where it should have been hinted, thus throwing it out of sync.

1, Forced PAL 25 FPS original frame rate. If the original source was 24 FPS and PAL is set
to 1, then this can DRAMATICALLY reduce the effectiveness of ExBlend() due to it hinting
out blends and overriding what should have been a blend detection. This will again, throw
it out of sync.

The R (RATIO) metrics flag will be displayed in orange at any time the ratio is not within expected
bounds, including during the AUTO PAL detection period (if it was a 25 FPS clip originally)
but will disappear once AUTO PAL has switched.

Original source rate is what you will try to recover. [what it was before the blends were erroneously produced in the bad source to be fixed].

flossy_cake
5th March 2024, 08:54
I have an NTSC region 1 DVD ("The Ray Bradbury Theater") where some episodes were shot in New Zealand at 25fps film and they appear to have converted it to 30i using a 3:2:3:2:2 cadence with no blended fields. Some other episodes appear to be using 23.0fps with a 3:3:2:3:2 cadence. These episodes look fine when played back at 60p as the judder is not really visibly different from 3:2 judder imo.

StainlessS
5th March 2024, 21:09
Is there a question in there ?

It dont sound as if ExBlend can do anything with it.

flossy_cake
7th March 2024, 11:00
Is there a question in there ?

Sorry no just a comment. If 25p goes well enough into 30i with 3:2:3:2:2 then there probably isn't any need for the authors to field blend it, and no need to deblend it.

Another one is PAL DVD of Curb Your Enthusiasm which is fieldblended from 30i 2:2 --> 25i 1:1 . This one can't be IVTC'd as each field is a unique image with a different blend amount from the original 30p frames.

tormento
22nd September 2024, 12:38
Where can I find the latest version of exblend?

StainlessS
22nd September 2024, 13:58
Where can I find the latest version of exblend?
@ MediaFire in my sig [under any of my posts when logged in]
Or direct link here:- https://www.mediafire.com/folder/hb26mthbjz7z6/StainlessS

tormento
22nd September 2024, 16:06
Or direct link here
:thanks:

tormento
22nd September 2024, 19:09
Seems a bit difficult to properly tweak.

Any help about this (https://forum.doom9.org/showthread.php?p=2007251#post2007251) would be welcome.

StainlessS
23rd September 2024, 11:21
Does not look suitable source to me.
Originally intended for

ExBlend(), is a plugin originally written for telecined clips that were downsized from 720x480 to VCD 352x240.
The damage caused by this, looks similar to 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.
Where damage is due to Deinterlacing of telecined clips, it is likely that a denoised detection clip is required
as although the damage looks quite similar, it is not exactly the same.

Use with defaults but with PAL = 0,

int pal -1, 0, 1 , Default 0, lets Exblend() know what the original frame rate was.

This sets the filters hints, after a blended pair is found, the detector will preset
3 (23.976/24 FPS) frames either side of the pair to HINTED meaning No Blend. If 'pal' (25 FPS)
is set to 1, it will preset 4 frames either side to HINTED. This helps it fall
into sync with sequence but may have slight delayed detection if the sequence goes
out of sync. If a frame has already been preset (visited) then the hint will not
be set, this allows hints to work when scanning both forward and backwards.
Not sure if PAL is actually useful or not, never seen any clip that exhibited this
problem with a good/blended signature of GGGGBBGGGGBBGGGG etc, where there are 4
good frames and 2 blends. As it did not add much difficulty to the plugin, PAL was
implemented just incase it was ever found to be useful.

-1 AutoPal mode. (MODE 0 ONLY)
If you are not sure what the original source was you can set PAL = -1 (MODE 0 Only).
If "Unblended:Blended Pairs" Ratio is between (4.0-0.01) and 5.0 at frame 1500 (1500=60*25
= 60 seconds @ 25 FPS), it will auto switch to PAL hints, the first 60 seconds
could contain the odd extra false blend pair detection.
If AUTO PAL is activated, the Metrics P (PAL) flag is hi-lited. It's
not a good idea to rely on this auto pal switch, you should set pal=1 when you
see it in orange. If autopal is activated and you later see the ratio rise above
5.0, then it would seem that the autopal detection was in error, this can happen
if the 1st 60 seconds contains a lot of static scenes with little movement, in this
case you should change to PAL=0 to disable the autopal detection and force it
to 23/24FPS original frame rate. Again, if the 1st 60 seconds contains a lot of static
scenes and it was originally PAL 25 FPS then the autopal may fail to detect and not
auto switch to PAL mode, in this case, ratio will later fall to above 4.0 and below
about 5.0. In this case you should change to PAL=1 to force PAL mode.

0, Forced 24 (or 23.976) FPS original frame rate (Default).
If the original source was 25 FPS and PAL is set
to 0, then this can reduce the effectiveness of ExBlend() due to it erroneously
detecting false blends where it should have been hinted, thus throwing it out of sync.

1, Forced PAL 25 FPS original frame rate. If the original source was 24 FPS and PAL is set
to 1, then this can DRAMATICALLY reduce the effectiveness of ExBlend() due to it hinting
out blends and overriding what should have been a blend detection. This will again, throw
it out of sync.

The R (RATIO) metrics flag will be displayed in orange at any time the ratio is not within expected
bounds, including during the AUTO PAL detection period (if it was a 25 FPS clip originally)
but will disappear once AUTO PAL has switched.

After full scan RATIO flag should NOT be orange, not suitable source.
Also, [EDIT: Below SHOW=4 or SHOW=5 metrics]

4 Show Blend count and ratio

BlendPairs =w (max=x)
Ratio =y (z%)

Gives a count of detected blend pairs and the ratio of
Unblended to BlendPairs. When you have scanned from start to end of the
clip (without jumping about or going backwards) 'Ratio' should give a
result of 3.xxxx for 24 FPS original and 4.xxxx for 25 FPS original,
meaning 3 good frames and 2 blended for 24 FPS or 4 good and 2 blended
for 25 FPS.
Should only scan forward (Otherwise, BlendPairs & Ratio will
be wrong). Following ratio, the percentage of detected blends is displayed,
based on the current pal mode, this may give a more humanistic idea as to
how well ExBlend() is doing.
Following BlendPairs (max=x) is displayed where x is the maximum number of
blend pairs that could exist in the clip using the current PAL mode, this
will change if AUTO PAL switch is activated. The max value displayed assumes
also that the clip stays in sequence throughout, if it does not, the true
max value could well vary from that shown and the true percentage of blends
found could well be higher or lower than shown, but not by much (small
fraction of a percent, probably).
Also note, ExBlend() may not detect the first or last blends in a clip due
to it needing 3 frames both before and after the current frame to do it's
detections.


The Ratio % (above "Ratio =y (z%)") should be at least about 95% otherwise
is unlikely to be suitable source for fix.

Was never envisaged to be useful for anything other than badly converted NTSC DVD downsized for VCD/SVCD.

EDIT: At a minimum, there should be constant stream of 3 good frames, and 2 bad/blurred frames.

flossy_cake
28th September 2024, 13:19
The holy grail would be to have an argument where the user can specify arbitrary patterns like ExBlend(pattern="GGGBBBGGBB"). It's painful to think about how this might be implemented.

flossy_cake
12th November 2025, 16:59
@StainlessS

Hello again StainlessS a year later!

I am still happily enjoying ExBlend - that whole box set of Mad About You was saved by your Avisynth filter, otherwise that show would have been lost to the sands of time.

I was wondering if you might be able to comment on this...

I have 25p video where every frame appears to be approximately a 30% blend with the previous frame. Here is a short clip (https://drive.google.com/uc?export=download&id=1yVliVchnWchSZWC_i0ZDL-vyqV2QsbBN) (the tip of the spears they are holding exemplify it)

In theory is it possible to deblend this?

Cheers

StainlessS
13th November 2025, 07:06
Sorry, is for an very specific type of double blending only.

flossy_cake
13th November 2025, 12:27
Sorry, is for an very specific type of double blending only.

No worries, I am more interested if you think it's possible in theory? Like, is that kind of frameblending pattern reversible in your opinion, or is information already lost in a way that would make it not even logically possible?

The way I'm imagining it in my mind, if every current frame is a 30% blend with the previous frame, then does that mean all I would need to do is "subtract" some kind of 30% dimmed version of the previous frame from the current frame? Something like that?

edit: after mucking around with Overlay(mode="subtract") it seems the answer is no - I can subtract a Levels() dimmed version of the previous frame, but that previous frame itself has a blend with its own previous frame and that is causing dark halos around moving objects (the dark bits are where it's subtracted the bits of the blend from 2 frames ago). If I go into double rate deinterlacing mode the blend alternates between current and next frame so that might allow some more information into the system to reconstruct the original unblended frame, but just thinking about how to subtract them in both directions to "get out" the original frame is doing me a concern and I think I'll just give up :)

wonkey_monkey
13th November 2025, 15:46
This seems to work fairly well:

prev = last.trim(0,-1) + last
expr(last, prev, "x y 0.3 * - 0.7 /")

https://i.imgur.com/V0czS2E.png

But the black background of the clip may be hiding things. Can you provide a more natural clip?

In theory, you could add back in an even smaller amount of two-frame separated information to compensate for newly-introduced haloes, and so on to infinity, but in practice this approach doesn't usually turn out that great (one problem with your subtract method is clipping at each iteration; you could try converting to float, but I think my expr method is preferable).

flossy_cake
14th November 2025, 05:10
This seems to work fairly well:

prev = last.trim(0,-1) + last
expr(last, prev, "x y 0.3 * - 0.7 /")


But the black background of the clip may be hiding things. Can you provide a more natural clip?

In theory, you could add back in an even smaller amount of two-frame separated information to compensate for newly-introduced haloes, and so on to infinity, but in practice this approach doesn't usually turn out that great (one problem with your subtract method is clipping at each iteration; you could try converting to float, but I think my expr method is preferable).


Amazing, I didn't even know about this expr function until now.

And I'm learning about "reverse Polish notation"... AI explained it to me with push/pop logic and I seem to understand it actually means (x-0.3y)/0.7 where x=last, y=prev. So "for each YUV channel, multiple prev clip's value by 0.3, subtract it from the current clip's channel, then brighten it back to where it was by dividing by the reciprocal (0.7)"

It seems to work well!

I tested on some scenes, a value of 0.3 works best, on other scenes 0.2 works best. Maybe cause the blend amount drifts slightly in a 29.97 to 50.0 blend. For now I pick a median value of 0.25

But there is a problem: scenechanges. The source fieldblends over scenechanges too there can be a luminance flash on scenechanges. I need to detect scenechanges and just output the source clip on those. No problem, easy to do in a scriptclip, but scenechange detection isn't totally foolproof

Here is a remux clip with some motion on other coloured backgrounds if you can be bothered looking at it and maybe offering a suggestion how to "add back in an even smaller amount of two-frame separated information to compensate for newly-introduced haloes": https://drive.google.com/uc?export=download&id=1ViyLuJcg9XVddgbKeHE6z8uyK9k6FMlU

It's the PAL DVD of Ernest Goes to Africa that I just bought off ebay, MPEG2 576i25. I'm guessing the movie was probably shot at 30fps or something like that and fieldblended to 50i. There are a couple of rogue scenes in the intro which look like they were shot at 24 but the rest of the movie is all 30 so that blend pattern is pretty much a lock so luckily we don't need some sophisticated locking algorithm like StainlessS has implemented in ExBlend to deal with cadence breaks. There probably are cadence breaks in Ernest too but it just ends up not mattering for whatever reason, the blend direction is always the same

NOTE: it's TFF and needs half rate deinterlacing to produce the blend pattern we've been discussing. I also tried just vinversing instead and that results in frames with an even smaller blend with prev+next, like maybe 10% in both directions. Fieldmatching first doesn't seem to help from what I can tell but I could be wrong.

:thanks: