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 28th November 2011, 18:34   #1  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
IVTC but ignoring part of the video frame from pattern search?

Is there any way to do an automated IVTC using TFM, Telecide, or similar but ignore certain pixel areas of the input video? I'm thinking of things like station logos or in frame popover advertisements / message that are interlaced content superimposed on top of telecined film based content. When the film based content has little motion and the superimposed interlaced video portion is moving around the proper fields to reconstruct the tend to be misdetected leaving interlaced fields in the output.

I'm thinking of something like being able to load an alpha mask from a .png and anything masked out is omitted from the pattern search. This would allow the logos or advertisements to be masked from the pattern search and allow the IVTC to work correctly on the underlying film content.

Is there a way to do this with any existing plugins?

Thanks!
Stereodude is offline   Reply With Quote
Old 28th November 2011, 19:49   #2  |  Link
TheRyuu
warpsharpened
 
Join Date: Feb 2007
Posts: 787
Requires two passes:
Pass 1:
Crop video (no superimposed stuff) -> feed to tfm -> specify output file.

Pass 2:
Call tfm with the override file set to the output file you made from pass 1 on the whole video.

You can also do some magic with y0/y1 params too although that won't work horizontally (or so people tell me).

Last edited by TheRyuu; 28th November 2011 at 19:53.
TheRyuu is offline   Reply With Quote
Old 28th November 2011, 20:34   #3  |  Link
cretindesalpes
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
 
cretindesalpes's Avatar
 
Join Date: Feb 2009
Location: No support in PM
Posts: 712
Another solution (single pass):

Code:
# Your source here
h = Height ()
m = ImageSource("mask.png", end=FrameCount()-1).ShowRed ("YV12")
c = mt_merge (last, m, m, luma=true)
StackVertical (c, last)
TFM (y0=h, y1=h*2-1)
Crop (0, h, 0, 0)
You'll have to define a mask file where the masked parts are pure white, and valid parts pure black.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding
cretindesalpes is offline   Reply With Quote
Old 28th November 2011, 20:59   #4  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
Thanks! I'll give these a try later today when I get home from work.
Stereodude is offline   Reply With Quote
Old 29th November 2011, 04:19   #5  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
Quote:
Originally Posted by cretindesalpes View Post
Another solution (single pass):

Code:
# Your source here
h = Height ()
m = ImageSource("mask.png", end=FrameCount()-1).ShowRed ("YV12")
c = mt_merge (last, m, m, luma=true)
StackVertical (c, last)
TFM (y0=h, y1=h*2-1)
Crop (0, h, 0, 0)
You'll have to define a mask file where the masked parts are pure white, and valid parts pure black.
This worked well. I am impressed by your guru like knowledge of how to work magic with AVIsynth.

I modified it a little bit to further what I was after.

Code:
inputvid=MPEG2Source("videoclip.d2v", idct=5, moderate_h=40, moderate_v=80, cpu2="xxoooo")
h = inputvid.Height()
m = ImageSource("frame_mask.png", end=FrameCount(inputvid)-1).ShowRed("YV12")
c = mt_merge(inputvid, m, m, luma=true)
composite=StackVertical(c1, inputvid).TFM(d2v="videoclip.d2v", y0=h, y1=h*2-1,mode=5, PP=0)

full=composite.crop(0, h, -0, -0)
masked=composite.crop(0, 0, -0, -h)
output=masked.tdecimate(mode=0, clip2=full)
output
Thanks for the help!

Last edited by Stereodude; 29th November 2011 at 04:21.
Stereodude 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 05:51.


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