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 Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd October 2020, 19:07   #1461  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
I've mentioned this elsewhere, but tfm's comb-detection algorithms are crap. The cthresh and mthresh have to be set as low as 1 or 2 to detect all combing that is readily visible to the human eye, and yet anything below 7 produces staggeringly high false positives. What are the chances that we'll ever get better comb-detection?
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 23rd October 2020, 21:58   #1462  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Katie, you're welcome to have a go at it. Distinguishing combing from detail is a very difficult problem. Calling people's heuristic solutions crap is over-the-top, especially when the solution is widely used.
videoh is offline   Reply With Quote
Old 24th October 2020, 17:35   #1463  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Donald is right. Besides, Ferenc is the only person who picked up the project and maintained it after it was abandoned by tritical, so he didn't create it and he's not accountable for what you consider a design flaw of an automated solution.
For what it's worth, it's not perfect, but it works and if it wasn't for Ferenc we wouldn't have had it compatible with proper high bit depth...
Still, it's an open source project, if you think there are some things that can be done better, anyone can fork it, modify it, test it and open a push request.
FranceBB is offline   Reply With Quote
Old 25th October 2020, 09:06   #1464  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
New TIVTC version: TDeint 1.7 (September 2020) and TIVTC v1.0.23 (20201020)
Code:
[TIVTC] RequestLinear: fix: initial "internal error - frame not in cache"
The startup of the filter contained an unhandled case which occured in multithreading environment when clim>0
pinterf is offline   Reply With Quote
Old 26th October 2020, 09:29   #1465  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Thanks for the update.
FranceBB is offline   Reply With Quote
Old 29th October 2020, 16:28   #1466  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by Katie Boundary View Post
I've mentioned this elsewhere, but tfm's comb-detection algorithms are crap. The cthresh and mthresh have to be set as low as 1 or 2 to detect all combing that is readily visible to the human eye, and yet anything below 7 produces staggeringly high false positives. What are the chances that we'll ever get better comb-detection?
I'm sure I've suggested this elsewhere, but try adjusting the combing detection in a different way. Reducing cthresh & mthresh so much isn't necessarily the best way to do it.

I was working with a problem source a few days ago. TDeint was missing small sections of combing. All it took to fix it was reducing the value for MI and changing the metric used for combing detection.

TDeint(mode=1, tryWeave=true, MI=50, metric=1)

TFM has the same MI and metric arguments as TDeint.
hello_hello is offline   Reply With Quote
Old 29th October 2020, 18:31   #1467  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Good point H.H.
Also, methinks Metric=0 by default, whereas Metric=1 seems to work betterer
__________________
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 29th October 2020, 20:06   #1468  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
I had to get rid of some residual interlacing and I found a [-1,2,6,2,-1] kernel (vertical) did a decent job. The source material wasn't fantastic quality to begin with, though:

__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 30th October 2020, 17:21   #1469  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by wonkey_monkey View Post
I had to get rid of some residual interlacing and I found a [-1,2,6,2,-1] kernel (vertical) did a decent job. The source material wasn't fantastic quality to begin with, though:
Excuse my lack of understanding, but how do you use a custom kernel?
hello_hello is offline   Reply With Quote
Old 30th October 2020, 17:39   #1470  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by hello_hello View Post
Excuse my lack of understanding, but how do you use a custom kernel?
mt_convolution("1","-1 2 6 2 -1",u=3,v=3) should do it
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 5th November 2020, 23:39   #1471  |  Link
Dwedit
Registered User
 
Join Date: Sep 2020
Posts: 10
I have a question. After using tfm and tdecimate, you've turned a 60 fields/sec interlaced video into 24 FPS progressive video.

Given a frame number within that 24 FPS video, how do you determine which fields were combined to make that given frame?

Is there a function I can call to query for the field numbers? Do I need to parse the TFM log file? Do I need to manually match the pixels of the frames?

(whoops, this probably belongs in a different thread)

Last edited by Dwedit; 6th November 2020 at 01:05.
Dwedit is offline   Reply With Quote
Old 7th November 2020, 03:26   #1472  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
Quote:
Originally Posted by Dwedit View Post
I have a question. After using tfm and tdecimate, you've turned a 60 fields/sec interlaced video into 24 FPS progressive video.

Given a frame number within that 24 FPS video, how do you determine which fields were combined to make that given frame?

Is there a function I can call to query for the field numbers? Do I need to parse the TFM log file? Do I need to manually match the pixels of the frames?

(whoops, this probably belongs in a different thread)

If the internal display=true (p, c, n, b, u) matches and/or debugmode output are not enough info for the field matching step, and display=true not enough for the decimation step, and you want original field numbers -

You can explicitly label the field numbers pre field matching (e.g. using stackvertical with blankclip, separatefields(), selecteven/odd and showframenumber (now field number), with top and bottom labels ;exclude those labels from the actual calculations by using the TFM y0,y1 exclusion band parameters. Tdecimate has the clip2 parameter, so you calculate metrics on the input clip (without labels), but display clip2 with the field info for preview purposes. (Of course you don't want to encode the display version with field info, adjust the script for final encode)


eg.

Code:
orig=MPEG2Source("blah.d2v)

origpad = stackvertical(blankclip(orig,  height=64), orig)

toppad=origpad.assumetff().separatefields().selecteven().showframenumber(x=0, y=20)

bottompad=origpad.assumetff().separatefields().selectodd().showframenumber(x=100, y=20)

padded=interleave(toppad, bottompad).assumetff().weave()

fieldmatchedpad=padded.TFM(pp=0, y0=0, y1=64) 

origfieldmatched=orig.TFM(pp=0)

IVTC = origfieldmatched.TDecimate(clip2=fieldmatchedpad)

IVTC
This example was for a TFF video, and you can change the display formatting if you want - but the way this is setup is the left number is the original source top field numbering , right number is bottom field numbering

So if current frame was 90, but top left says 113, top right says 112, it means IVTCed frame 90 was derived from top field of original frame 113, bottom field of original frame 112

Last edited by poisondeathray; 7th November 2020 at 03:28.
poisondeathray is offline   Reply With Quote
Old 7th November 2020, 22:03   #1473  |  Link
Dwedit
Registered User
 
Join Date: Sep 2020
Posts: 10
Okay, a bit more information...

I'm working on a plugin that will detect 60FPS motion (end credits and other moving text) overlayed over 24FPS telecined video.

Telecined video has a repeating 2-field, then 3-field sequence. If you are looking for moving text at 60 fields per second, you'd want to look at a 3-field sequence. First and Third field will have an identical background, and only the text should move.

This filter would run in conjunction with TFM and TDECIMATE. But in order to figure out whether we are in a 3-field sequence or a 2-field sequence, I'd need to go from Decimated Frame Number to two source Field Numbers, and also know which field number was discarded from a 3-field sequence.

Is there any good place to add such a query function?
Dwedit is offline   Reply With Quote
Old 8th November 2020, 02:54   #1474  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,345
Quote:
Originally Posted by Dwedit View Post
Okay, a bit more information...

I'm working on a plugin that will detect 60FPS motion (end credits and other moving text) overlayed over 24FPS telecined video.

Telecined video has a repeating 2-field, then 3-field sequence. If you are looking for moving text at 60 fields per second, you'd want to look at a 3-field sequence. First and Third field will have an identical background, and only the text should move.

This filter would run in conjunction with TFM and TDECIMATE. But in order to figure out whether we are in a 3-field sequence or a 2-field sequence, I'd need to go from Decimated Frame Number to two source Field Numbers, and also know which field number was discarded from a 3-field sequence.

Is there any good place to add such a query function?


That info is not retained in a filter chain with different plugins or filters. You'd have to modify TFM and TDecimate

Is it for a detection plugin only? or is the plugin going to do something about it eg. create mask , or filter it, or something ?

What is the end goal or intended purpose? e.g. lets say you detect frames 100-200 have 59.94 overlay motion over 23.976 BG. Now what ?
poisondeathray is offline   Reply With Quote
Old 14th December 2020, 04:21   #1475  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
the change log seems to say that greyscale supported, but with
Code:
source
Converttoy8()
TFM()
I get
__________________
See My Avisynth Stuff

Last edited by real.finder; 14th December 2020 at 04:35.
real.finder is offline   Reply With Quote
Old 14th December 2020, 16:07   #1476  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Thanks for the report.
Download TIVTC 1.0.24

EDIT: see 1.0.25 later

Code:
**v1.0.24 (20201214)**
- Fix: TFM: do not give error on greyscale clip

Last edited by pinterf; 14th December 2020 at 20:26.
pinterf is offline   Reply With Quote
Old 14th December 2020, 18:55   #1477  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by pinterf View Post
Thanks for the report.
Download TIVTC 1.0.24

Code:
**v1.0.24 (20201214)**
- Fix: TFM: do not give error on greyscale clip
thanks, but seems there are the same problem in tdecimate maybe the others too
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 14th December 2020, 20:07   #1478  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by real.finder View Post
thanks, but seems there are the same problem in tdecimate maybe the others too
Yep, that poor TDecimate has 'chroma'=true by default. What a cruel world. Had to mod all other TIVTC filters as well to silently set chroma=false for greyscale clips. Because you could still set chroma=true for them manually. Stay tuned.
pinterf is offline   Reply With Quote
Old 14th December 2020, 20:26   #1479  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Download TIVTC 1.0.25 + TDeint 1.8

Code:
** TDeInt v1.8 (20201214)
- Fix: TDeint: ignore parameter 'chroma' and treat as false for greyscale input

**v1.0.25 (20201214)**
- Fix: TFM, TDecimate and others: treat parameter 'chroma' as "false" for greyscale clips

**v1.0.24 (20201214)**
- Fix: TFM: do not give error on greyscale clip
pinterf is offline   Reply With Quote
Old 14th December 2020, 20:34   #1480  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Phew!, that was qwik.
Thanks.
__________________
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
Reply

Tags
tdeint, tivtc

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 14:52.


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