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. |
18th September 2018, 06:34 | #1 | Link |
Cary Knoop
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
|
Treat interlaced as temporary progressive
This works fine:
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] Is it a bug or am I doing something wrong? Last edited by Cary Knoop; 18th September 2018 at 06:54. |
18th September 2018, 09:40 | #2 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet Last edited by Myrsloik; 18th September 2018 at 09:43. |
|
18th September 2018, 15:26 | #3 | Link |
Cary Knoop
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
|
The source is definitely TFF.
Interestingly this does work: 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=False)[::2] Edited to add: uncommented the SetFieldBased functions Last edited by Cary Knoop; 19th September 2018 at 18:30. |
19th September 2018, 17:34 | #4 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
I can't reproduce the original issue or vertical shift
I started with a 4:2:0 8bit TFF source . I checked with core.text.ClipInfo , and it's "labelled" TFF internally, and also checked with separatefields, so verified the content is also TFF . Also verified in avisynth I tried both fmtc (going back to 8bit 4:2:0 with point), and zimg/zlib resizers, both work ok . You would expect it to be lossless operation using Point/nearest neighbor No difference with MakeDiff, or amplified differences |
19th September 2018, 17:59 | #5 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
using fmtc
(because fmtc resample only uses 16bit or 32bit , you have to go back down to 8bit 4:2:0 to compare to original) Code:
a = core.d2v.Source(input=r'blah.d2v') b = core.std.SeparateFields(a, tff=True) b = core.fmtc.resample(b, scalev=2, css="444", kernel="point") b = core.fmtc.resample(b, scalev=0.5, css="444", kernel="point") b = core.fmtc.resample (b, css="420", kernel="point") b = core.fmtc.bitdepth (b, bits=8) b = core.std.DoubleWeave(b, tff=True)[::2] d = core.std.MakeDiff(a,b, planes=[0,1,2]) da = core.std.Levels(d, min_in=127, max_in=129, gamma=1, min_out=0, max_out=255, planes=[0,1,2]) da.set_output() For the DoubleWeave TFF vs BFF - if you wanted BFF , you would need to offset and select "odd" fields instead so it would be [1::2] instead of [::2] or clip = core.std.SelectEvery(clip, cycle=2, offsets=1) And that works ok too If there still is an issue, provide more info on the source, source filter , maybe upload a sample |
19th September 2018, 19:01 | #7 | Link | ||
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
Quote:
?? Which is it ? With or without ? Check both the flagging / internal field order with core.text.ClipInfo , and the actual field order by bobbing or separating fields |
||
19th September 2018, 19:04 | #8 | Link | |
Cary Knoop
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
|
Quote:
Without the two SetFieldBased functions, everything works fine. With the two SetFieldBased functions there is a shift that goes away when I set the DoubleWeave to BFF instead of TFF. |
|
19th September 2018, 20:34 | #11 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
Can you give a scenario where you would actually use that? When you separate fields , it's no longer field based ... technically all operations should be progressive after that point Once you weave it back into fields, then it's field based. Then all operations should be treated as fields |
|
19th September 2018, 20:43 | #12 | Link | |
Cary Knoop
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
|
Quote:
That seems like a bug to me. I isolated the problem I found during coding, not sure why questioning what I am using it for has any bearing if something is a bug or not. Last edited by Cary Knoop; 19th September 2018 at 20:47. |
|
19th September 2018, 21:04 | #13 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
When you separate fields, it's no longer "field based", nothing has to be "set" . You would apply whatever operations/filters in a progressive manner (because fields are current separated it's technically progressive) You don't have to manually override anything. Setting props are only used when you have something flagged incorrectly (e.g. content might be TFF, but flagged BFF or vice versa) , or progressive content flagged incorrectly or vice versa . That can affect other operations e.g if you resize interlaced material in a progressive manner, it will produce artifacts . |
|
19th September 2018, 21:16 | #14 | Link |
Cary Knoop
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
|
Perhaps I was wrong in even reporting this on this forum, how silly of me thinking I was doing a service to the Vapoursynth product, reporting that something might be a bug
Last edited by Cary Knoop; 19th September 2018 at 21:18. |
19th September 2018, 21:22 | #15 | Link |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
How about posting a short sample of your source?
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
|
19th September 2018, 21:48 | #16 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
Don't be discouraged to report bugs... I can reproduce the behaviour, and I guess you could argue it's a "bug" ... maybe it's a glass half empty / half full thing But on the other hand , you could argue it's not "field based", and you shouldn't be using SetFieldBased for that... If you wanted to do this for some reason, you should be using SetFrameProp after separatefields, which works and passes that info to the next filter like fmtc e.g Code:
c = core.std.SetFrameProp(c, prop="_FieldBased", intval=2) #0=frame based (progressive), 1=bottom field first, 2=top field first. |
|
19th September 2018, 21:48 | #17 | Link |
Cary Knoop
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
|
I already did that:
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] |
19th September 2018, 21:52 | #18 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
It looks to me like the SetFieldBased isn't being passed to the 2nd fmtc.resample correctly
If you "forced" it by adding interlaced=True, tff=1, to make it matching it also works Code:
c = core.std.SetFieldBased(c, 2) c = core.fmtc.resample(c, scalev=0.5, css="444", kernel="point", interlaced=True, tff=1) But SetFrameProp seems more robust and can set/override more parameters |
19th September 2018, 21:56 | #19 | Link | |
Cary Knoop
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
|
Quote:
Code sometimes works in mysterious ways Last edited by Cary Knoop; 19th September 2018 at 21:59. |
|
20th September 2018, 06:29 | #20 | Link | |
Cary Knoop
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 397
|
Quote:
|
|
|
|