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 > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th September 2018, 07:03   #21  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Cary Knoop View Post
Hmm, I have trouble to get this to work properly, can you confirm this actually works for you in the test case I provided?
Yes, in the test case I provided (8bit 4:2:0 source)

Just replace the SetFieldBased lines with SetFrameProp lines between the resample lines

You can verify with MakeDiff , as shown in the earlier example
poisondeathray is offline   Reply With Quote
Old 20th September 2018, 07:12   #22  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Quote:
Originally Posted by poisondeathray View Post
Yes, in the test case I provided (8bit 4:2:0 source)

Just replace the SetFieldBased lines with SetFrameProp lines between the resample lines

You can verify with MakeDiff , as shown in the earlier example
But that case is different right?

This does NOT work for me:

Code:
c = core.std.SeparateFields(c, tff=True)
c = core.fmtc.resample(c, scalev=2, css="444",
                                 kernel="point")
c = core.std.SetFieldBased(c, 0)
c = core.std.SetFieldBased(c, 2)
c = core.fmtc.resample(c, scalev=0.5, css="444",
                                 kernel="point")
c = core.std.DoubleWeave(c, tff=True)[::2]
Remove both SetFieldBased functions and it works.

This does NOT work for me either:

Code:
c = core.std.SeparateFields(c, tff=True)
c = core.fmtc.resample(c, scalev=2, css="444",
                                 kernel="point")
c = core.std.SetFieldBased(c, 0)
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=2)
c = core.fmtc.resample(c, scalev=0.5, css="444",
                                 kernel="point")
c = core.std.DoubleWeave(c, tff=True)[::2]
However, this does work (and the source is definitely TFF):

Code:
c = core.std.SeparateFields(c, tff=True)
c = core.fmtc.resample(c, scalev=2, css="444",
                                 kernel="point")
c = core.std.SetFieldBased(c, 0)
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=2)
c = core.fmtc.resample(c, scalev=0.5, css="444",
                                 kernel="point")
c = core.std.DoubleWeave(c, tff=False)[::2]
Cary Knoop is offline   Reply With Quote
Old 20th September 2018, 07:24   #23  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
You forgot to replace the other SetFieldBased. (Don't use SetFieldBased. At all)

Quote:
Just replace the SetFieldBased lines with SetFrameProp lines between the resample lines
ie
instead of
Code:
c = core.std.SetFieldBased(c, 0)
c = core.std.SetFieldBased(c, 2)
use
Code:
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=0)
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=2)
poisondeathray is offline   Reply With Quote
Old 20th September 2018, 07:42   #24  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Quote:
Originally Posted by poisondeathray View Post
You forgot to replace the other SetFieldBased. (Don't use SetFieldBased. At all)



ie
instead of
Code:
c = core.std.SetFieldBased(c, 0)
c = core.std.SetFieldBased(c, 2)
use
Code:
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=0)
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=2)
I tried that but it does not work for me.

But, this does work:

Code:
c = core.std.SeparateFields(c, tff=True)
c = core.fmtc.resample(c, scalev=2, css="444",
                                 kernel="point")
ntval=2)
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=0)
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=2)
c = core.fmtc.resample(c, scalev=0.5, css="444",
                                 kernel="point")
c = core.std.DoubleWeave(c, tff=False)[::2]
In effect:

Code:
c = core.std.SetFieldBased(c, 0)
c = core.std.SetFieldBased(c, 2)
And

Code:
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=0)
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=2)
Are equivalent, and both require the Double Weave to use BFF to work correctly.
Cary Knoop is offline   Reply With Quote
Old 20th September 2018, 07:50   #25  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
It works here. There is a clear handling difference, and you can verify it again by explicitly forcing the resample switch for interlaced=True/False, tff=0/1 . In one case the behaviour of resample follows what the props are set to (SetFrameProp). In the other, they are not (SetFieldBased) .

If it doesn't work for you, we are back to : what is your source, what is your source filter
poisondeathray is offline   Reply With Quote
Old 20th September 2018, 08:22   #26  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Quote:
Originally Posted by poisondeathray View Post
It works here. There is a clear handling difference, and you can verify it again by explicitly forcing the resample switch for interlaced=True/False, tff=0/1 . In one case the behaviour of resample follows what the props are set to (SetFrameProp). In the other, they are not (SetFieldBased) .
So to confirm, this one does not work for you:

Code:
c = core.std.SeparateFields(c, tff=True)
c = core.fmtc.resample(c, scalev=2, css="444",
                                 kernel="point")
c = core.std.SetFieldBased(c, 0)
# 
#  Some progressive processing
#
c = core.std.SetFieldBased(c, 2)
c = core.fmtc.resample(c, scalev=0.5, css="444",
                                 kernel="point")
c = core.std.DoubleWeave(c, tff=True)[::2]
But this one does:

Code:
c = core.std.SeparateFields(c, tff=True)
c = core.fmtc.resample(c, scalev=2, css="444",
                                 kernel="point")
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=0)
# 
#  Some progressive processing
#
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=2)
c = core.fmtc.resample(c, scalev=0.5, css="444",
                                 kernel="point")
c = core.std.DoubleWeave(c, tff=True)[::2]
For me, they both do not work, and if I change tff=False in the DoubleWeave() they both work!

Last edited by Cary Knoop; 20th September 2018 at 08:25.
Cary Knoop is offline   Reply With Quote
Old 20th September 2018, 15:11   #27  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Cary Knoop View Post
So to confirm, this one does not work for you:

Code:
c = core.std.SeparateFields(c, tff=True)
c = core.fmtc.resample(c, scalev=2, css="444",
                                 kernel="point")
c = core.std.SetFieldBased(c, 0)
# 
#  Some progressive processing
#
c = core.std.SetFieldBased(c, 2)
c = core.fmtc.resample(c, scalev=0.5, css="444",
                                 kernel="point")
c = core.std.DoubleWeave(c, tff=True)[::2]
But this one does:

Code:
c = core.std.SeparateFields(c, tff=True)
c = core.fmtc.resample(c, scalev=2, css="444",
                                 kernel="point")
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=0)
# 
#  Some progressive processing
#
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=2)
c = core.fmtc.resample(c, scalev=0.5, css="444",
                                 kernel="point")
c = core.std.DoubleWeave(c, tff=True)[::2]
For me, they both do not work, and if I change tff=False in the DoubleWeave() they both work!


Yes; and "not work" means shifting or difference . "Work" means no shifting or difference (confirmed by MakeDiff) . "Work" means the props are passed to the next filter


If you explicitly set interlaced=True, tff=1 for the 2nd fmtc.resample (and keeping DoubleWeave tff=true) what happens ?



Recall I said if you use c=core.std.SetFieldBased(c,2) , you can also "fix" it by explicitly forcing the next resample to interlaced=True, tff=1 (ie. c = core.fmtc.resample(c, scalev=0.5, css="444", kernel="point", interlaced=True, tff=1). At least those are what I'm seeing here. That suggests those SetFieldBased properties are not being passed to the next filter (the behaviour of the next filter isn't taking your SetFieldBased override into account automatically).

But when you use SetFrameProp(c,prop="_FieldBased", intval=2) it works, whether or not you explicitly set interlaced=True, tff=1 . That suggests that info is being passed to the next filter automatically and it's being used .But, if you force interlaced=False or tff=0, you get artifacts and shifting too because it's being done differently

This is potentially important because not all filters have explicit interlaced=true/false, TFF/BFF switches. Some rely on what the props are.

So how are you "viewing" this or converting to RGB for viewing ?

For me, SetFieldBased doesn't work as expected and it says in the documentation it's experimental. But SetFrameProp works, and works on many parameters , not just the ones here

Last edited by poisondeathray; 20th September 2018 at 15:19.
poisondeathray is offline   Reply With Quote
Old 20th September 2018, 17:17   #28  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
I can confirm that for TFF sources, in trivial cases, the SetFrameProp with DoubleWeave() using TFF works.
But it does not work for the code I use, perhaps this is related to some filters not using the props.

Adding the code I use, which uses all kinds of filters, is simply too complex to put here.
But the code does work if DoubleWeave() uses BFF both for SetFrameProp() and SetFieldBased().

I suspect something in Vapoursynth sets information always to BFF regardless whether the source is TFF or BFF after applying SeparateFields().
Cary Knoop is offline   Reply With Quote
Old 20th September 2018, 20:05   #29  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Cary Knoop View Post
I can confirm that for TFF sources, in trivial cases, the SetFrameProp with DoubleWeave() using TFF works.
But it does not work for the code I use, perhaps this is related to some filters not using the props.

Adding the code I use, which uses all kinds of filters, is simply too complex to put here.
But the code does work if DoubleWeave() uses BFF both for SetFrameProp() and SetFieldBased().
Since you agree in the simple case SetFrameProp is working as expected, and when you add your code it's not working as expected, doesn't that logically suggest it's an issue with your additional code / filters ?



Quote:
I suspect something in Vapoursynth sets information always to BFF regardless whether the source is TFF or BFF after applying SeparateFields().
Maybe, but that's not supported by what you have provided or my observations

You're probably going to have to provide something more concrete and tangible, something that can be reproduced to demonstrate the problem clearly
poisondeathray is offline   Reply With Quote
Old 20th September 2018, 22:11   #30  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
I draw my conclusion, I will use BFF for DoubleWeave, right now that works in all cases.
Cary Knoop is offline   Reply With Quote
Old 24th September 2018, 21:25   #31  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
Quote:
Originally Posted by poisondeathray View Post
Since you agree in the simple case SetFrameProp is working as expected, and when you add your code it's not working as expected, doesn't that logically suggest it's an issue with your additional code / filters ?
After research of the code in between every time SetFieldBased() is used a problem appears.

I would not use SetFieldBased() at all.

Thanks for your help!
Cary Knoop 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 15:55.


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