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

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

 

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

Reply
 
Thread Tools Search this Thread Display Modes
Old 17th June 2022, 22:15   #41  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,312
I'm on Windows 11.
Quote:
Also, I seem to remember that no XBD file will be generated unless a complete scan is done {ie, it does not write a partially complete file}
I called my clip with "avs2yuv64.exe c:\Users\Selur\Desktop\test2.avs NUL" which runs through the whole thing.

I now opened the script in avsmod, changed the call to
Code:
Exblend(mode=1, ExBfile="e:\Exbfile", debug=true, lv=5, dv=5)
downloaded and started Debugview and scrolled through the clip in avspmod.

Tried to save the content of Debugview, but then Debugview, simple froze.
-> took a screenshot and killed Debugview.

Now E:\Exbfile_1.LOG was created, when I closed avspmod which contains:
Code:
ExBlend: INFO,    
ExBlend: INFO,    ExBlend() v1.04 - 18 Dec 2018 - (c) StainlessS.
ExBlend: INFO,    
ExBlend: DEBUG,   Limiting args to 'Mode 1'
ExBlend: DEBUG,   Checking Colorspace
ExBlend: DEBUG,   Checking valid 'mode'
ExBlend: DEBUG,   Checking valid 'pal' range
ExBlend: DEBUG,   Allocating fdat[]
ExBlend: DEBUG,   Allocating MetricsDat[]
ExBlend: INFO,    ------------------------------------
ExBlend: INFO,    MODE                    = 1
ExBlend: INFO,    PAL                     = 0
ExBlend: INFO,    LOCKTHRESH              = 1,00
ExBlend: INFO,    ITHRESH                 = 3,00
ExBlend: INFO,    SHOW                    = 5 
ExBlend: INFO,    EXBFILE                 = 'e:\Exbfile'
ExBlend: INFO,    VER                     = False
ExBlend: INFO,    REVIP                   = False
ExBlend: INFO,    OVERRIDE                = NOT SET
ExBlend: INFO,    LV                      = 5 DEBUG
ExBlend: INFO,    DV                      = 5 DEBUG
ExBlend: INFO,    DISP                    = 1 EXBLEND [Default]
ExBlend: INFO,    DCLIP                   = NO
ExBlend: INFO,    COMPUB                  = 2 0=SSSS, 1=SDDS 2=DDDD [S=Source,D=DClip]
ExBlend: INFO,    DECIMATE                = False
ExBlend: INFO,    DECOMPIX                = 1 UNUSED
ExBlend: INFO,    DecClpIx                = 1 
ExBlend: INFO,    DEBUG                   = True
ExBlend: INFO,    ------------------------------------
ExBlend: DEBUG,   LOG Filename            = e:\Exbfile_1.LOG
ExBlend: DEBUG,   LOG file Verbosity      = 5
ExBlend: DEBUG,   LOG DebugView Verbosity = 5
ExBlend: DEBUG,   XBD Filename            = e:\Exbfile.XBD
ExBlend: DEBUG,   FRAMES Filename         = e:\Exbfile_Decimated.TXT
ExBlend: DEBUG,   ------------------------------------
ExBlend: DEBUG,   Constructor, no Errors encountered.
ExBlend: DEBUG,   Constructor OUT  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ExBlend: INFO,    [569] Lost Sequence: Detected=2
ExBlend: DEBUG,   Destructor IN    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
ExBlend: DEBUG,   Mode 1, checking if clip fully scanned.
ExBlend: DEBUG,   Mode 1, Buffer Incomplete ( 0,3 Percent)
ExBlend: DEBUG,   delete[] MetricsDat
ExBlend: DEBUG,   delete[] fdat
ExBlend: DEBUG,   Destructor OUT (CLOSING LOG) >>>>>>>>>>>>>>>>>>>>
>>>
No e:\Exbfile.XBD or e:\Exbfile_Decimated.TXT file was created.

Cu Selur
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 18th June 2022 at 00:02.
Selur is offline   Reply With Quote
Old 18th June 2022, 00:11   #42  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
OK, I think I twigged whats happening,
Quote:
I called my clip with "avs2yuv64.exe c:\Users\Selur\Desktop\test2.avs NUL" which runs through the whole thing.
think that avs2yuv64 is returning to frame 0 after scan, which I've a sneaky feeling will start afresh ie reset, as if nothing has been scanned.
I'm not on my compiler machine, and not even on windows at present, I'll see what I can do when I can.

EDIT: I've never actually used avs2yuv. [or cant remember it if I have done]

EDIT:
I still doubt that it would do any good if it is to follow this
Code:
TFM() # field match back to a film frames
TDecimate() #remove duplicates
but that's a different matter.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 18th June 2022 at 00:18.
StainlessS is offline   Reply With Quote
Old 18th June 2022, 00:42   #43  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Selur,
https://forum.doom9.org/showthread.p...53#post1846853
above linked RT_ForceProcess() will scan entire file and NOT return to frame 0 on completion. [if that is any good]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 18th June 2022, 06:56   #44  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,312
Thanks will look whether I get RT_ForceProcess working.
a. Okay, the link in that thread doesn't work, but I got the RT_Stats_25&26_x86_x64_dll_v2.00Beta13_20201229.zip from your MediaFire site.
b. Looked at the source the TFM&Decimate isn't needed, source is wrongly flagged as interlaced while it's progressive (+ blended fields).
-> okay, I got no idea how to use that properly.
using:
Code:
ClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
LoadPlugin("I:\Hybrid\64bit\Avisynth\AVISYN~1\LSMASHSource.dll")
Import("I:\Hybrid\64bit\Avisynth\avisynthPlugins\mtmodes.avsi")
LoadPlugin("C:\Users\Selur\Desktop\ExBlend_x64.dll")
LoadPlugin("C:\Users\Selur\Desktop\RT_Stats_x64.dll")
LWLibavVideoSource("e:\clips\Courage the Cowardly Dog S02E17E18 SOURCE.mkv",cache=false,dr=true,format="YUV420P8", prefer_hw=0)
org=last
#Exblend(mode=1, ExBfile="e:\Exbfile", debug=true, lv=5, dv=5)
RT_ForceProcess()
#Exblend(mode=0,revip=true, show=0)
#StackHorizontal(last, org)
PreFetch(16)
#  output: color sampling YV12@10, matrix: bt709, scantyp: progressive, luminance scale: limited
return last
also doesn't output a file (I could find), but it shows some stuff in the debugviewer.


Cu Selur
Ps.: Also uploaded the source to my GoogleDrive
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 18th June 2022 at 07:20.
Selur is offline   Reply With Quote
Old 18th June 2022, 14:25   #45  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Selur,
OK, Exblend only writes XBD file on exblend input clip [EDIT: ExBlend Filter] destructor, so we need to do a little hack for RT_ForceProcess thingy to work.

Code:
VideoFileName   ="E:\SELUR\Courage the Cowardly Dog S02E17E18 SOURCE.dgi"
DGSource(VideoFileName)
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
EDIT: Above we had a bit of an 'Interoperability' style problem, as RT_ForceProcess returns only a 0 [TwriteAVI::ForceProcess() does return a clip and would probably be more suitable].
So, we had to kill input clip to Exblend instead of output clip. Making Last=0 [instead of "TMP=0"] after RT_ForceProcess() does not work, not sure why.

EDIT: Above PASS2 is decimated result, so any StackHorizontal whatsit will be out-of-sync frames.

EDIT: Metrics on last frame [single pass only] show 92.53% of maximum possible blend pair detections,
I would only use ExBlend() if above about 95% or 96%. [EDIT: Although it is a short clip and does fluctuate about 92% -> 96%, longer clip would be better accuracy %]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 18th June 2022 at 15:58.
StainlessS is offline   Reply With Quote
Old 18th June 2022, 15:38   #46  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
With stackhorizontal

Code:
VideoFileName   ="E:\SELUR\Courage the Cowardly Dog S02E17E18 SOURCE.dgi"
DGSource(VideoFileName)
ORG=Last

TMP=ORG
TMP.Exblend(mode=1, ExBfile=".\Exbfile", debug=true, lv=5, dv=5)
#return last Return Pass 1

RT_ForceProcess()
TMP=0 # kill TMP clip and call ExBlend filter destructor

ORG

SHOW=1
Exblend(mode=2,ExBfile=".\Exbfile",Decimate=False,Disp=1,Show=SHOW)  # Non decimated, Blend pair replaced with 2 x copies of ex-blended frame. Little colored block flags ex-Blended frame pair.
#Exblend(mode=2,ExBfile=".\Exbfile")                                 # Deblended & Decimated

# Both below lines for Non Decimated ONLY.
StackHorizontal(ORG,Last)
#Subtract(ORG,Last)

Return last
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 18th June 2022 at 16:02.
StainlessS is offline   Reply With Quote
Old 20th June 2022, 14:27   #47  |  Link
Julek
Registered User
 
Julek's Avatar
 
Join Date: Dec 2020
Posts: 94
Quote:
Originally Posted by Selur View Post
Ps.: Also uploaded the source to my GoogleDrive
In this case there is no new information in the combed frame, it's just the prev blended with the next, the correct way here is to just drop it like this:

Code:
import vapoursynth as vs
core = vs.core

src = core.lsmas.LWLibavSource(r"C:\Users\conta\Videos\src\dog.mkv")
decimate = src.std.SelectEvery(cycle=5, offsets=[0, 1, 2, 4])
decimate.set_output()
But since the pattern is not fixed, you would have to adjust the offsets for each scene.
__________________
CPU: AMD 3700X | GPU: RTX 3070Ti | RAM: 32GB 3200MHz
GitHub
Julek is offline   Reply With Quote
Old 20th June 2022, 16:58   #48  |  Link
Julek
Registered User
 
Julek's Avatar
 
Join Date: Dec 2020
Posts: 94
Quote:
Originally Posted by Julek View Post
In this case there is no new information in the combed frame, it's just the prev blended with the next, the correct way here is to just drop it like this:

Code:
import vapoursynth as vs
core = vs.core

src = core.lsmas.LWLibavSource(r"C:\Users\conta\Videos\src\dog.mkv")
decimate = src.std.SelectEvery(cycle=5, offsets=[0, 1, 2, 4])
decimate.set_output()
But since the pattern is not fixed, you would have to adjust the offsets for each scene.
I just noticed that the background is true 30 fps, so decimate would not be ideal.
I will try to make a script to replace the damaged part using a mask.
__________________
CPU: AMD 3700X | GPU: RTX 3070Ti | RAM: 32GB 3200MHz
GitHub
Julek is offline   Reply With Quote
Old 20th June 2022, 17:12   #49  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,312
Quote:
But since the pattern is not fixed, you would have to adjust the offsets for each scene.
I know I could go scene by scene and manually drop fields, but that really is a pain to do for a whole file and not just a snipped.
I'm looking for some way to automate this.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 21st June 2022, 18:32   #50  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,312
@StainLess: Finally found the time to test it, and with this 2pass works fine: Thanks for the help!
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 6th August 2023, 22:04   #51  |  Link
Drommer
Registered User
 
Join Date: Jul 2023
Posts: 5
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!
Drommer is offline   Reply With Quote
Old 7th August 2023, 18:19   #52  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
In Mode=1,
Set PAL=1.
Also, see "Override", https://forum.doom9.org/showthread.p...86#post1860486
Code:
                 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.p...46#post1558846
Quote:
Originally Posted by StainlessS View Post
Here from an example clip courtesy of JohnMeyer from his thread here:-
http://forum.doom9.org/showthread.php?t=162599




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.

Code:
# ##########################################################################
# 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])



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
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 7th August 2023 at 18:48.
StainlessS is offline   Reply With Quote
Old 7th August 2023, 19:06   #53  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
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.
johnmeyer is offline   Reply With Quote
Old 7th August 2023, 19:42   #54  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
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.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 25th September 2023, 19:23   #55  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 635
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 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

Code:
# 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)
flossy_cake is offline   Reply With Quote
Old 25th September 2023, 19:57   #56  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
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.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 26th September 2023, 04:25   #57  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 635
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.
flossy_cake is offline   Reply With Quote
Old 26th September 2023, 12:48   #58  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Posted elsewhere onsite
Quote:
Originally Posted by StainlessS View Post
@ 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
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 4th October 2023, 07:44   #59  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,160
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:
Code:
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


Frame 375


Frame 387


Frame 395


Frame 399
kedautinh12 is offline   Reply With Quote
Old 9th October 2023, 03:07   #60  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 635
Quote:
Originally Posted by kedautinh12 View Post
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():



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:

Code:
# 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/1mzM...ew?usp=sharing

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



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?

Last edited by flossy_cake; 9th October 2023 at 05:15.
flossy_cake is offline   Reply With Quote
Reply

Tags
blending, unblending

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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

Forum Jump


All times are GMT +1. The time now is 16:25.


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