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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 30th October 2025, 01:27   #1  |  Link
Lathe
Registered User
 
Lathe's Avatar
 
Join Date: Aug 2005
Posts: 1,437
I cannot figure out what the deal is with this encode...

I've been remastering a bunch of old movies, downloads, DVDs, etc., and I came across this one where I couldn't figure out what the deal is. It LOOKS like a usual DVD 29.xxx which would normally be detelecined, but it looked awful when I did that.

So, I looked more carefully at the MediaInfo and it showed as interlaced TFF. So, then I tried the AVS script for that using Assume(TFF) and then SeparateFields() and then tried both Weave and FieldDeinterlace(blend_true) separately and ALL of these looked worse!

So, I'm wondering what the deal is what I should do. I ripped this DVD a long time ago and I don't think I did anything different than I usually do, but I can't get this one to look right without some kind of weird constant 'Combing', which I know isn't really real combing, but looks like it, except it looks continuous.

Here is a 45 second snippet. I really appreciate anyone who can tell me what's going on with this encode and what I could do to improve it. I can always add sharpening and other stuff later, but I want to get the picture rendering right first.

Thanks!

http://lathe-of-heaven.com/00000.mkv
Lathe is offline   Reply With Quote
Old 30th October 2025, 01:47   #2  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,886
It may be flagged as interlaced TFF, and technically be so, but the visual result is progressive frames, with every 5th frame repeated. SelectEvery(6,0,1,2,3,4) or something like that should fix it (if the pattern is stable).
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 30th October 2025, 01:55   #3  |  Link
Lathe
Registered User
 
Lathe's Avatar
 
Join Date: Aug 2005
Posts: 1,437
Quote:
Originally Posted by wonkey_monkey View Post
It may be flagged as interlaced TFF, and technically be so, but the visual result is progressive frames, with every 5th frame repeated. SelectEvery(6,0,1,2,3,4) or something like that should fix it (if the pattern is stable).
Hey thanks! That's the kind of esoteric thing I would NEVER figure out!

So, I should just add that line of code as you showed it, and that's all? And, also, according to what you said, I should NOT then use any deinterlacing steps like I mentioned that I did in my original post, right?

Thanks again kindly mate!
Lathe is offline   Reply With Quote
Old 30th October 2025, 01:59   #4  |  Link
Lathe
Registered User
 
Lathe's Avatar
 
Join Date: Aug 2005
Posts: 1,437
Hmmm... no, in addition to my thankful post above, that just made it more jittery. It must need another combination I guess...
Lathe is offline   Reply With Quote
Old 30th October 2025, 01:59   #5  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,886
You might need to change which number to skip, so it would be one of

Code:
SelectEvery(6, 0,1,2,3,4)
SelectEvery(6, 0,1,2,3,5)
SelectEvery(6, 0,1,2,4,5)
SelectEvery(6, 0,1,3,4,5)
SelectEvery(6, 0,2,3,4,5)
SelectEvery(6, 1,2,3,4,5)
Again assuming the pattern is perfectly stable throughout. If not, something like Tdecimate might work well enough (it's not guaranteed to be perfect).
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 30th October 2025, 03:03   #6  |  Link
Lathe
Registered User
 
Lathe's Avatar
 
Join Date: Aug 2005
Posts: 1,437
Quote:
Originally Posted by wonkey_monkey View Post
You might need to change which number to skip, so it would be one of

Code:
SelectEvery(6, 0,1,2,3,4)
SelectEvery(6, 0,1,2,3,5)
SelectEvery(6, 0,1,2,4,5)
SelectEvery(6, 0,1,3,4,5)
SelectEvery(6, 0,2,3,4,5)
SelectEvery(6, 1,2,3,4,5)
Again assuming the pattern is perfectly stable throughout. If not, something like Tdecimate might work well enough (it's not guaranteed to be perfect).
Thanks man, I'll try that. I did originally try Tdecimate when I thought it was just a regular DVD. So, if I do that again, assuming the dropping the different frames doesn't work, would I use it like I normally do with both commands:

TFM()
TDecimate()

And, with the SelectEvery commands above, do I need to add anything else before that, or just try each of those commands separately?

Last edited by Lathe; 30th October 2025 at 03:06.
Lathe is offline   Reply With Quote
Old 30th October 2025, 03:16   #7  |  Link
Lathe
Registered User
 
Lathe's Avatar
 
Join Date: Aug 2005
Posts: 1,437
Nope... Sadly, none of those worked and only made it way more jerky and comby...

I tried each one of those commands separately, but the result for every one looked about the same.

So, is my only choice then to use TDecimate? And do I use the other command preceding it like I usually do? Is that about all I can do? I wonder, SPECIFICALLY why this particular encode looks this way, I wish someone could identify EXACTLY what is wrong with it.

Thanks again Bro!
Lathe is offline   Reply With Quote
Old 30th October 2025, 03:19   #8  |  Link
Lathe
Registered User
 
Lathe's Avatar
 
Join Date: Aug 2005
Posts: 1,437
Heh, no, in addition to my 2 comments above, using TFM and TDecimate also makes it all comby and stuff, although not as jerky removing the frames. I guess just leaving it alone is my best option, but I sure WISH I could understand exactly what is happening with this encode that I haven't run across in the many others I've been doing.
Lathe is offline   Reply With Quote
Old 30th October 2025, 03:35   #9  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,669
The default cycle for TDecimate is 5. You need 6 . 1 in 6 decimation

TDecimate(cycle=6)

You have some residual combing, you could use vinverse or vinverse2 to smooth them
poisondeathray is offline   Reply With Quote
Old 30th October 2025, 03:49   #10  |  Link
Lathe
Registered User
 
Lathe's Avatar
 
Join Date: Aug 2005
Posts: 1,437
Quote:
Originally Posted by poisondeathray View Post
The default cycle for TDecimate is 5. You need 6 . 1 in 6 decimation

TDecimate(cycle=6)

You have some residual combing, you could use vinverse or vinverse2 to smooth them
Ah, thanks! I know you are one of THE long standing 'Heavies' here who knows a LOT about this stuff...

So, I should try the command as you show it above then, right? Do I precede it with TFM()?

I'm not conversant with exactly how TDecimate works. So isn't the '1 in 6' decimation what I was trying to do with the commands the other fellow suggested?

And, can you explain WHY the encode is the way it is since it is very different from all the others I have been doing lately, thanks!

Not familiar with vinverse, but I'll look it up to see if I can find the dll to put in my plugins folder and what the syntax is.

***EDIT

Ah, I DO have to use the TFM() command with it, I see the difference. That does help. I'll look for the vinverse function and see what I can find, but that is better!

Last edited by Lathe; 30th October 2025 at 03:58.
Lathe is offline   Reply With Quote
Old 30th October 2025, 04:08   #11  |  Link
Lathe
Registered User
 
Lathe's Avatar
 
Join Date: Aug 2005
Posts: 1,437
Yep, that did help! I used the 2 commands above and I found vinverse. I don't understand how it works, but this apparently is the default configuration which I used:

Vinverse(sstr=2.7, amnt=255, uv=3, scl=0.25)

And YES, it did seem to remove pretty much most the combing. If you wouldn't mind, please, perhaps explaining what these parameters do, and how changing each one affects it so that I can use and modify it to optimise it in the future. Thank you!

***EDIT

Oh, I think I understand most of it. the amnt pretty much stays the same, the uv means simply to process the chroma, and the scl I guess sharpens it somewhat, but I don't understand how. So, I'm GUESSING that you can change the 1st and last parameter for modifying. I don't quite understand what the 2.7 does or how you might change it or why. And, I don't understand why there would be a sharpening and I guess with negative values(?) a bluring factor. Wouldn't that simply be done with another function.

But, overall, yes, that does help a lot and it's always great to know one more AVS function!

***EDIT 2

Okay, I think I understand better now... The amt merely is a 'Hard limiter' on how much of the pixels are affected which I guess can be lowered if the effects of the sharpening are too much overall. The sharpening factor is not a general sharpener, but it apparently affects the anticombing that has been done on certain areas. I'll play around with the sharpening to see how it looks.

A nice new tool I can use!

Last edited by Lathe; 30th October 2025 at 04:26.
Lathe is offline   Reply With Quote
Old 30th October 2025, 05:04   #12  |  Link
Lathe
Registered User
 
Lathe's Avatar
 
Join Date: Aug 2005
Posts: 1,437
Uh oh... now the picture looks pretty good, but the A/V is out of sync! I tried setting MKVMerge at 23.xxx for the video but it looks like the video lasts longer than the audio and the runtime is 1:26 instead of 1:23 like it is supposed to be. However, when I set MKVMerge to render it at 29.xxx which is its original rate, the runtime is indeed 1:23, but it is still way out of sync. I guess I'll try 25? I don't know quite what to do...

***EDIT

Well, at least I keep figuring out things for myself, so there is that...

I went ahead and did the remux with MKVMerge, but this time I DIDN'T set the frame rate. I've been doing that each time I've Detelecined a DVD and it has worked just fine. BUT... in allowing MKVMerge to do its 'Own' thing, now it IS perfectly in sync! Whaddayuno! I checked the resulting framerate of the final result and it is a mysterious 24.975 FPS! But, at least it's in sync.

I can't claim to understand all this stuff, but I guess it's kinda nice to (with some desperately needed help!) to stumble into it working right.

Thanks for the input gentlemen. Now, on to the next old show...

Last edited by Lathe; 30th October 2025 at 05:10.
Lathe is offline   Reply With Quote
Old 30th October 2025, 11:18   #13  |  Link
Columbo
Registered Developer
 
Join Date: Sep 2025
Location: Chi-town
Posts: 229
You decimated 1 in 6, so the resulting frame rate will be:

29.97 * (5 / 6) = 24.975 fps
Columbo is offline   Reply With Quote
Old 30th October 2025, 13:27   #14  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 242
Try this. (Requires VMAF & vinverse)

Quote:
LWLibavVideoSource("INPUT.mkv")

global c = last
global n = DoubleWeave(c).SelectOdd()
global p = DoubleWeave(c).SelectOdd().DuplicateFrame(0)
global c = VMAF2(c,vinverse(c),feature = 0)
global n = VMAF2(n,vinverse(n),feature = 0)
global p = VMAF2(p,vinverse(p),feature = 0)
c
ScriptClip("""
n_metric = propGetFloat(n,"psnr_y") + propGetFloat(n,"psnr_cb") + propGetFloat(n,"psnr_cr")
c_metric = propGetFloat(c,"psnr_y") + propGetFloat(c,"psnr_cb") + propGetFloat(c,"psnr_cr")
p_metric = propGetFloat(p,"psnr_y") + propGetFloat(p,"psnr_cb") + propGetFloat(p,"psnr_cr")
n_metric > c_metric && n_metric > p_metric ? n : \
p_metric > c_metric && p_metric > n_metric ? p : c
""")
takla is offline   Reply With Quote
Old 30th October 2025, 15:34   #15  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,669
I think TDecimate(mode=7, rate=25) is more correct for a 25 fps "PAL" to 30000/1001 "NTSC" area generic conversion


Synthetic test
Code:
blankclip(length=2500, fps=25, pixel_type="YV12")
showframenumber()
changefps(30000,1001)
#tdecimate(cycle=6) #missing frames 833, 1836; 2497 total frames

tdecimate(mode=7, rate=25) #2499 total frames ,  missing last frame but probably from way synthetic test was "cut"

In your example , there is a dropped frame between 819-820 (decimated frame numbers) when TDecimate(Cycle=6) is used, compared to TDecimate(mode=7, rate=25) . You can check more closely on full video

Last edited by poisondeathray; 30th October 2025 at 15:44.
poisondeathray is offline   Reply With Quote
Old 30th October 2025, 23:04   #16  |  Link
Lathe
Registered User
 
Lathe's Avatar
 
Join Date: Aug 2005
Posts: 1,437
Quote:
Originally Posted by Columbo View Post
You decimated 1 in 6, so the resulting frame rate will be:

29.97 * (5 / 6) = 24.975 fps
Annnnnnnnd, this is why I'm here... Thank you Sir!
Lathe is offline   Reply With Quote
Old 30th October 2025, 23:07   #17  |  Link
Lathe
Registered User
 
Lathe's Avatar
 
Join Date: Aug 2005
Posts: 1,437
Quote:
Originally Posted by takla View Post
Try this. (Requires VMAF & vinverse)
HOLY SMOKES man, that is WAY above my paygrade! I'll try to play around with that so I can learn, but wow... I was very glad though to learn about the vinverse, that was extremely helpful. I've always wondered if there was something that helped with combing effects.

Thanks Bro!
Lathe is offline   Reply With Quote
Old 30th October 2025, 23:08   #18  |  Link
Lathe
Registered User
 
Lathe's Avatar
 
Join Date: Aug 2005
Posts: 1,437
Quote:
Originally Posted by poisondeathray View Post
I think TDecimate(mode=7, rate=25) is more correct for a 25 fps "PAL" to 30000/1001 "NTSC" area generic conversion


Synthetic test
Code:
blankclip(length=2500, fps=25, pixel_type="YV12")
showframenumber()
changefps(30000,1001)
#tdecimate(cycle=6) #missing frames 833, 1836; 2497 total frames

tdecimate(mode=7, rate=25) #2499 total frames ,  missing last frame but probably from way synthetic test was "cut"

In your example , there is a dropped frame between 819-820 (decimated frame numbers) when TDecimate(Cycle=6) is used, compared to TDecimate(mode=7, rate=25) . You can check more closely on full video
Ah, that is interesting! I'm REALLY glad to be able to learn more the workings of stuff like this, thanks mate!
Lathe is offline   Reply With Quote
Reply


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 20:32.


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