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 6th January 2013, 12:59   #1  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Exblend Problem

I wanna deblend a video with "exblend" because it gives me better results than FixBlendIVTC
but the problem is exblend deblends some normal frames which produces very bad output and leaves some blended frames untouched
the source is a typical 3:2 patterned vid but it seems exblend didn't work by patterns, normal frames are "deblended" and blended frames are unprocessed
Is there any way to make exblend work by pattern like writing a "ovr" file in TIVTC "xxxx,xxxx +++--"?
feisty2 is offline   Reply With Quote
Old 6th January 2013, 13:10   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Take a look at the override arg, heres a snippet from it:

Code:
 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.
EDIT: If unsuccessful upload a small sample to mediafire.

EDIT: Change to full override text.
__________________
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; 6th January 2013 at 17:03.
StainlessS is offline   Reply With Quote
Old 6th January 2013, 13:18   #3  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by StainlessS View Post
Take a look at the override arg, heres a snippet from it:

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.
EDIT: If unsuccessful upload a small sample to mediafire.
It works, I trimmed 400 frames to test it,the blended frames are frame 2,3,7,8,12,13..... I write a ovr file "2=*400" and it works perfectly,but pattern changes during scene changing,Do I need to trim every scene out and write a ovr file for all of them?

Last edited by feisty2; 6th January 2013 at 13:36.
feisty2 is offline   Reply With Quote
Old 6th January 2013, 13:19   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I found your sample in other thread, gonna take a peek at it.
__________________
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 6th January 2013, 13:48   #5  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Are you using the beta version (thats what I'm using) ?
__________________
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 6th January 2013, 13:50   #6  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by StainlessS View Post
Are you using the beta version (thats what I'm using) ?
I'm using ExBlend103b_25_dll_20120215
feisty2 is offline   Reply With Quote
Old 6th January 2013, 16:03   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
That clip does go out of sync, when eg fade to black and in blended scene transitions, perhaps other places too.

ExBlend was intended for VCD conversions, but actually copes quite well with your clip.
It's getting above 96% of blend detections although it loses sync at above mentioned transitions, having problems
deciding between what is target blend and the blend transition.

Have not tried FixBlendIVTC on this but I'm guessing the ExBlend will produce better results especially with additional
MC denoising on corrected frames ONLY.

Check this out:
Code:
Import("D:\avs\bank\mcdegrain.avs")
MPEG2Source("D:\AVS\AVI\sample.d2v")
AssumeBFF()
Crop(0,92,-0,-92)	# Get rid of most borders [mod 4]
########################################
# Use this

#Return Exblend(mode=1,lv=5,debug=true) 					            # 1st Pass
EXB=Exblend(mode=2)
#Return ClipClop(EXB,MCDegrain(EXB,3),CMD="ExBlend_Decimated.TXT")		# 2nd Pass, DONE, can use favorite MC denoise filter



########################################
#         DISPLAY 4 IMAGE CLIP         #
########################################
#                 #                    #
# Exblend         # Exblend+MCDegrain  #
#                 #                    #
########################################
#                 #                    #
# Blend 1         #     Blend 2        #
#                 #                    #
########################################

ORIGSUB=EXB.Subtitle("ORIGINAL",Align=1)

EXBDISP=ORIGSUB.ClipClop(EXB.SubTitle("Exblend",Align=1),CMD="ExBlend_Decimated.TXT")
MCD=ORIGSUB.ClipClop(MCDegrain(EXB,3).SubTitle("ExBlend_MCDegrain",Align=1),CMD="ExBlend_Decimated.TXT",show=true)
IX1=ORIGSUB.ClipClop(Exblend(mode=2,disp=0,Decompix=1).SubTitle("Blend_1",Align=1),CMD="ExBlend_Decimated.TXT")
IX2=ORIGSUB.ClipClop(Exblend(mode=2,disp=0,Decompix=2).SubTitle("Blend_2",Align=1),CMD="ExBlend_Decimated.TXT")

T=StackHorizontal(EXBDISP,MCD)
B=StackHorizontal(IX1,IX2)
Return StackVertical(T,B)
EDIT: The above script does pretty good, but if you want to spend a lot more time on it, then also use the Override
command file, see the produced log for where it loses sync.

Just saw your edit, you only need to force an override where it looses sync (see logs), not for every blend pair.

EDIT: Changed previous post to full override doc.
just use eg 2=*1 to force an override for the 1st blend index at frame 2, if goes out of sequence where eg frame
400, should be a blend index 1 detection, add a line to override file "400=*1". this will force it to start syncing at frame
400 and it should lock on untill next sequence break. ... etc.
eg 400=*1 set just a single override if it still goes out of sync at next 1st blend then use eg "400=*2" or more.

EDIT: The 4 windowed clip in script, shows sequences of 3 frames ALL showing "ORIGINAL" subtitle meaning original
frame used, and for every forth frame it shows Exblended, Exblended Mc Degrained, the original 1st blended frame,
and the original 2nd blended frame, so you can better judge how it fares. Output is the decimated output @ 23.976

EDIT: Dont EVER use DirectshowSource() with ExBlend().
__________________
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; 6th January 2013 at 17:34.
StainlessS is offline   Reply With Quote
Old 6th January 2013, 18:53   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Here a script to show FixBlendIVTC and ExBlend (undecimated) clips together.

Code:
Import("D:\avs\avs\FixBlendIVTC.avs")
MPEG2Source("D:\AVS\AVI\sample.d2v")
AssumeBFF()
Crop(0,92,-0,-92)	# Get rid of most borders [mod 4]
ORG=LAst
FB =ORG.FixBlendIVTC()
EXB=ORG.Exblend(mode=2,decimate=false,disp=2).AssumeFps(29.97)
Return StackVertical(Fb,Exb)
Exblend uses disp=2 to deblend frames in the same order as FixBlendIVTC (which one of the two is replaced,
Exblend normally duplicates the recovered unblend in both originally blended frames, whereas FixBlendIVTC
replaces the 2nd blend by the frame following it).

There will be some mismatch between them where they make different detections but are mostly the same.

I found a bug in ExBlend beta, when Decimate=false, it still outputs a 23.976 FPS clip when it should not, I've fixed in
above script just by an AssumeFPS.

Note, the FixBlendIVTC clip (top) has had denoising done on the unblended frames where ExBlend has not.

EDIT: Fixed ExBlend() decimate FPS bug in v1.03b2, thread here:
http://forum.doom9.org/showthread.php?t=157337

Or get it @ mediafire in sig.
__________________
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; 6th January 2013 at 20:33.
StainlessS is offline   Reply With Quote
Old 7th January 2013, 03:12   #9  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by StainlessS View Post
That clip does go out of sync, when eg fade to black and in blended scene transitions, perhaps other places too.

ExBlend was intended for VCD conversions, but actually copes quite well with your clip.
It's getting above 96% of blend detections although it loses sync at above mentioned transitions, having problems
deciding between what is target blend and the blend transition.

Have not tried FixBlendIVTC on this but I'm guessing the ExBlend will produce better results especially with additional
MC denoising on corrected frames ONLY.

Check this out:
Code:
Import("D:\avs\bank\mcdegrain.avs")
MPEG2Source("D:\AVS\AVI\sample.d2v")
AssumeBFF()
Crop(0,92,-0,-92)	# Get rid of most borders [mod 4]
########################################
# Use this

#Return Exblend(mode=1,lv=5,debug=true) 					            # 1st Pass
EXB=Exblend(mode=2)
#Return ClipClop(EXB,MCDegrain(EXB,3),CMD="ExBlend_Decimated.TXT")		# 2nd Pass, DONE, can use favorite MC denoise filter



########################################
#         DISPLAY 4 IMAGE CLIP         #
########################################
#                 #                    #
# Exblend         # Exblend+MCDegrain  #
#                 #                    #
########################################
#                 #                    #
# Blend 1         #     Blend 2        #
#                 #                    #
########################################

ORIGSUB=EXB.Subtitle("ORIGINAL",Align=1)

EXBDISP=ORIGSUB.ClipClop(EXB.SubTitle("Exblend",Align=1),CMD="ExBlend_Decimated.TXT")
MCD=ORIGSUB.ClipClop(MCDegrain(EXB,3).SubTitle("ExBlend_MCDegrain",Align=1),CMD="ExBlend_Decimated.TXT",show=true)
IX1=ORIGSUB.ClipClop(Exblend(mode=2,disp=0,Decompix=1).SubTitle("Blend_1",Align=1),CMD="ExBlend_Decimated.TXT")
IX2=ORIGSUB.ClipClop(Exblend(mode=2,disp=0,Decompix=2).SubTitle("Blend_2",Align=1),CMD="ExBlend_Decimated.TXT")

T=StackHorizontal(EXBDISP,MCD)
B=StackHorizontal(IX1,IX2)
Return StackVertical(T,B)
EDIT: The above script does pretty good, but if you want to spend a lot more time on it, then also use the Override
command file, see the produced log for where it loses sync.

Just saw your edit, you only need to force an override where it looses sync (see logs), not for every blend pair.

EDIT: Changed previous post to full override doc.
just use eg 2=*1 to force an override for the 1st blend index at frame 2, if goes out of sequence where eg frame
400, should be a blend index 1 detection, add a line to override file "400=*1". this will force it to start syncing at frame
400 and it should lock on untill next sequence break. ... etc.
eg 400=*1 set just a single override if it still goes out of sync at next 1st blend then use eg "400=*2" or more.

EDIT: The 4 windowed clip in script, shows sequences of 3 frames ALL showing "ORIGINAL" subtitle meaning original
frame used, and for every forth frame it shows Exblended, Exblended Mc Degrained, the original 1st blended frame,
and the original 2nd blended frame, so you can better judge how it fares. Output is the decimated output @ 23.976

EDIT: Dont EVER use DirectshowSource() with ExBlend().
thx,it works for most frames I appreciate it,but still remains the same old problem on other few frames
like this (combed 2 normal frames togther)

or this (doesn't comb blended frames togther)


any easy solution without writing ovr file?

Last edited by feisty2; 7th January 2013 at 05:12.
feisty2 is offline   Reply With Quote
Old 7th January 2013, 05:51   #10  |  Link
Forensic
Registered User
 
Join Date: Apr 2008
Location: California, USA
Posts: 127
@ StainlessS
You noted "EDIT: Dont EVER use DirectshowSource() with ExBlend()". Does DirectshowSource introduce a limitation that does not occur with avisource and FFVideoSource?
Forensic is offline   Reply With Quote
Old 7th January 2013, 13:48   #11  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
@Forensic,
DirectshowSource(), apart from being frame inaccurate (ExBlend detection requires access to 7 frames, 3 either side of current frame),
it may have auto deinterlacing, auto IVTC etc turned on in the DSS filters (eg mpeg decoder), IVTC would produce jumping video as it
constantly goes out of DSS IVTC sync. Deinterlacing would produce blends, had one user that was trying to get rid of blends introduced
in DSS. ExBlend is for Progressive only, deinterlace on real interlaced or telecine may produce blending.

@feisty2
I'm afraid you would need to use the override there, obviously something caused it to go out of sync (ie break in sequence) and it takes
a few frames to get back into sync, your clip constantly breaks sequence (probably as most music videos, changing scene,
looks like the scenes were handled individually and then joined together with blend transitions and a sequence break somewhere
within those blend transitions).
__________________
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 January 2013 at 14:08.
StainlessS is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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

Forum Jump


All times are GMT +1. The time now is 11:41.


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