This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Yadifmod de-interlacer doesn't work
#1
Attempt to use Yadifmod de-interlacer throws an error:
Avisynth - "... yadifmod2.dll' cannot be used as a plugin for AviSynth."
Vapoursynth - "...  Failed to evaluate the script: Python exception: znedi3: bad field operation."
Reply
#2
I see the problem.
-> will send you a link to a hopefully fixed dev version in a few minutes.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#3
(01.02.2021, 20:43)Selur Wrote: I see the problem.
-> will send you a link to a hopefully fixed dev version in a few minutes.

Cu Selur

dev_2021.02.01-194219 Vapoursynth still crashes.
Reply
#4
Strange seems to work fine here.
But the frame rate calculation seems to be wrong,...
-> no clue why it's crashing for you.

Cu Selur

Ps.: will send you a link with a version which properly tracks the frame rate inside the script, but that should not fix your crash. My guess is that it's related to your file,..
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#5
(01.02.2021, 22:05)Selur Wrote: Strange seems to work fine here.
But the frame rate calculation seems to be wrong,...
-> no clue why it's crashing for you.

Cu Selur

Ps.: will send you a link with a version which properly tracks the frame rate inside the script, but that should not fix your crash. My guess is that it's related to your file,..

dev_2021.02.01-213520 still the same - Yadifmod crashes both Avisynth and Vapoursynth.
The video I'm trying to process: https://drive.google.com/file/d/1x0U11Ii...sp=sharing

Have no issues to process this video using just 2 lines with AvsPmod and VirtualDub2, regardless input filter (FFmpegSource2(), LSMASHVideoSource(), LWLibavVideoSource()) :

yadifmod2(mode=1, edeint=nnedi3(field=-2))
srestore(frate=23.976)

It gives acceptable "srestored" output: https://drive.google.com/file/d/15hykYpV...sp=sharing
Would be great if you can reproduce the same result using "Hybrid"

(02.02.2021, 03:12)serg Wrote:
(01.02.2021, 22:05)Selur Wrote: Strange seems to work fine here.
But the frame rate calculation seems to be wrong,...
-> no clue why it's crashing for you.

Cu Selur

Ps.: will send you a link with a version which properly tracks the frame rate inside the script, but that should not fix your crash. My guess is that it's related to your file,..

dev_2021.02.01-213520 still the same - Yadifmod crashes both Avisynth and Vapoursynth.
The video I'm trying to process: https://drive.google.com/file/d/1x0U11Ii...sp=sharing

Have no issues to process this video using just 2 lines with AvsPmod and VirtualDub2, regardless input filter (FFmpegSource2(), LSMASHVideoSource(), LWLibavVideoSource()) :

yadifmod2(mode=1, edeint=nnedi3(field=-2))
srestore(frate=23.976)

It gives acceptable "srestored" output: https://drive.google.com/file/d/15hykYpV...sp=sharing
Would be great if you can show me how to reproduce the same result using "Hybrid"

Forgot debugs. Here they are.
Reply
#6
Quote:Have no issues to process this video using just 2 lines with AvsPmod and VirtualDub2, regardless input filter (FFmpegSource2(), LSMASHVideoSource(), LWLibavVideoSource()) :
Sadly, that does not help at all, since thaos two lines are no where near the script Hybrid uses.

Using:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'I:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/vsznedi3.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DeinterlaceFilter/Yadifmod/Yadifmod.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import havsfunc
# source: 'C:\Users\Selur\Desktop\hotel._10bit.mov'
# current color space: YUV422P10, bit depth: 10, resolution: 720x486, fps: 29.97, color matrix: 470bg, yuv luminance scale: limited, scanorder: bottom field first
# Loading C:\Users\Selur\Desktop\hotel._10bit.mov using LWLibavSource
clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/hotel._10bit.mov", format="YUV422P10", cache=0, fpsnum=30000, fpsden=1001, prefer_hw=0)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 29.97
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# deinterlacing using YadifMod
clip = core.yadifmod.Yadifmod(clip=clip, edeint=core.znedi3.nnedi3(clip=clip,field=2), order=0, mode=1) # new fps: 59.94
# adjusting frame count and rate with sRestore
clip = havsfunc.srestore(source=clip, frate=23.976, omode=6, speed=9, thresh=16, mode=2)
# adjusting output color from: YUV422P10 to YUV420P8 for x264Model (i420@10)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited")
# set output frame rate to 23.976fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# Output
clip.set_output()
Vapoursynth Preview works fine here.
Vapoursynth Filter Preview works fine here too.

Using:
ClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\LSMASHSource.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\yadifmod2.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\nnedi3.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\RgTools.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\mvtools2.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\masktools2.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\TIVTC.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\Average.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\GRunT.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\MedianBlur2.dll")
Import("I:\Hybrid\32bit\avisynthPlugins\Zs_RF_Shared.avsi")
Import("I:\Hybrid\32bit\avisynthPlugins\Srestore.avsi")
# loading source: C:\Users\Selur\Desktop\hotel._10bit.mov
#  color sampling YUY2@10, matrix: bt601, scantyp: bottom field first, luminance scale: limited
LWLibavVideoSource("C:\Users\Selur\Desktop\HOTEL_~1.MOV",cache=false,format="YUV422P16", prefer_hw=0)
# current resolution: 720x486
# deinterlacing
Yadifmod2(order=-1,mode=1,edeint=nnedi3(field=-2))
# removing ghosting
srestore(frate=23.976,omode=6)
# filtering
# Dithering from 16 to 8bit for encoder
ConvertBits(8)
# adjust color to YV12 (color matrix: Rec601)
ConvertToYV12()
# setting output fps to 23.976fps
AssumeFPS(24000,1001)
#  output: color sampling YV16@8, matrix: bt601, scantyp: progressive, luminance scale: limited
return last
Avisynth Preview works fine.
Avisynth Filter Preview works fine too.

Comparing the Avisynth scripts used for the filter preview:
From your debug output:
ClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\LSMASHSource.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\yadifmod2.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\nnedi3.dll")
# loading source: D:\Hybrid_test\Gill\hotel_10bit.mov
#  color sampling YUY2@10, matrix: bt601, scantyp: bottom field first, luminance scale: limited
Source = LWLibavVideoSource("D:\HYBRID~1\Gill\HOTEL_~1.MOV",cache=false,format="YUV422P16", prefer_hw=0)
# current resolution: 720x486
# deinterlacing
SourceFiltered = Source
Source = Source.Yadifmod2(order=-1,mode=1,edeint=Source.nnedi3(field=-2))
SourceFiltered = SourceFiltered.Yadifmod2(order=-1,mode=1,edeint=SourceFiltered.nnedi3(field=-2))
# filtering
# stacking horizontal for filter preview
# adjust color to RGB32 (for preview)
SourceFiltered = SourceFiltered.ConvertToRGB32(matrix="Rec601")
# adjust color to RGB32 (for preview)
Source = Source.ConvertToRGB32(matrix="Rec601")
StackHorizontal(Source, SourceFiltered)
PreFetch(2)
# setting output fps to 59.940fps
AssumeFPS(60000,1001)
#  output: color sampling RGB32@16, matrix: bt601, scantyp: progressive, luminance scale: limited
return last
on my system:
ClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
LoadPlugin("I:\INNOIN~1\32bit\AVISYN~1\LSMASHSource.dll")
LoadPlugin("I:\INNOIN~1\32bit\AVISYN~1\yadifmod2.dll")
LoadPlugin("I:\INNOIN~1\32bit\AVISYN~1\nnedi3.dll")
# loading source: C:\Users\Selur\Desktop\hotel._10bit.mov
#  color sampling YUY2@10, matrix: bt601, scantyp: bottom field first, luminance scale: limited
Source = LWLibavVideoSource("C:\Users\Selur\Desktop\HOTEL_~1.MOV",cache=false,format="YUV422P16", prefer_hw=0)
# current resolution: 720x486
# deinterlacing
SourceFiltered = Source
Source = Source.Yadifmod2(order=-1,mode=1,edeint=Source.nnedi3(field=-2))
SourceFiltered = SourceFiltered.Yadifmod2(order=-1,mode=1,edeint=SourceFiltered.nnedi3(field=-2))
# filtering
# stacking horizontal for filter preview
# adjust color to RGB32 (for preview)
SourceFiltered = SourceFiltered.ConvertToRGB32(matrix="Rec601")
# adjust color to RGB32 (for preview)
Source = Source.ConvertToRGB32(matrix="Rec601")
StackHorizontal(Source, SourceFiltered)
PreFetch(8)
# setting output fps to 59.940fps
AssumeFPS(60000,1001)
#  output: color sampling RGB32@16, matrix: bt601, scantyp: progressive, luminance scale: limited
return last
I see no real difference, so this seems to be somehow related to your setup.

Cu Selur

Ps.: You can try replacing the used dlls with older/different versions:
nnedi3: https://github.com/jpsdr/NNEDI3/releases
yadifmod2: https://github.com/Asd-g/yadifmod2/releases
may be some assembly optimizations are triggered which get triggered with your cpu, but not mine.
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#7
(02.02.2021, 05:49)Selur Wrote:
Quote:Have no issues to process this video using just 2 lines with AvsPmod and VirtualDub2, regardless input filter (FFmpegSource2(), LSMASHVideoSource(), LWLibavVideoSource()) :
Sadly, that does not help at all, since thaos two lines are no where near the script Hybrid uses.

Using:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'I:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/vsznedi3.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/DeinterlaceFilter/Yadifmod/Yadifmod.dll")
core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import havsfunc
# source: 'C:\Users\Selur\Desktop\hotel._10bit.mov'
# current color space: YUV422P10, bit depth: 10, resolution: 720x486, fps: 29.97, color matrix: 470bg, yuv luminance scale: limited, scanorder: bottom field first
# Loading C:\Users\Selur\Desktop\hotel._10bit.mov using LWLibavSource
clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/hotel._10bit.mov", format="YUV422P10", cache=0, fpsnum=30000, fpsden=1001, prefer_hw=0)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 29.97
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# deinterlacing using YadifMod
clip = core.yadifmod.Yadifmod(clip=clip, edeint=core.znedi3.nnedi3(clip=clip,field=2), order=0, mode=1) # new fps: 59.94
# adjusting frame count and rate with sRestore
clip = havsfunc.srestore(source=clip, frate=23.976, omode=6, speed=9, thresh=16, mode=2)
# adjusting output color from: YUV422P10 to YUV420P8 for x264Model (i420@10)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited")
# set output frame rate to 23.976fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# Output
clip.set_output()
Vapoursynth Preview works fine here.
Vapoursynth Filter Preview works fine here too.

Using:
ClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\LSMASHSource.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\yadifmod2.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\nnedi3.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\RgTools.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\mvtools2.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\masktools2.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\TIVTC.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\Average.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\GRunT.dll")
LoadPlugin("I:\Hybrid\32bit\AVISYN~1\MedianBlur2.dll")
Import("I:\Hybrid\32bit\avisynthPlugins\Zs_RF_Shared.avsi")
Import("I:\Hybrid\32bit\avisynthPlugins\Srestore.avsi")
# loading source: C:\Users\Selur\Desktop\hotel._10bit.mov
#  color sampling YUY2@10, matrix: bt601, scantyp: bottom field first, luminance scale: limited
LWLibavVideoSource("C:\Users\Selur\Desktop\HOTEL_~1.MOV",cache=false,format="YUV422P16", prefer_hw=0)
# current resolution: 720x486
# deinterlacing
Yadifmod2(order=-1,mode=1,edeint=nnedi3(field=-2))
# removing ghosting
srestore(frate=23.976,omode=6)
# filtering
# Dithering from 16 to 8bit for encoder
ConvertBits(8)
# adjust color to YV12 (color matrix: Rec601)
ConvertToYV12()
# setting output fps to 23.976fps
AssumeFPS(24000,1001)
#  output: color sampling YV16@8, matrix: bt601, scantyp: progressive, luminance scale: limited
return last
Avisynth Preview works fine.
Avisynth Filter Preview works fine too.

Comparing the Avisynth scripts used for the filter preview:
From your debug output:
ClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\LSMASHSource.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\yadifmod2.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\nnedi3.dll")
# loading source: D:\Hybrid_test\Gill\hotel_10bit.mov
#  color sampling YUY2@10, matrix: bt601, scantyp: bottom field first, luminance scale: limited
Source = LWLibavVideoSource("D:\HYBRID~1\Gill\HOTEL_~1.MOV",cache=false,format="YUV422P16", prefer_hw=0)
# current resolution: 720x486
# deinterlacing
SourceFiltered = Source
Source = Source.Yadifmod2(order=-1,mode=1,edeint=Source.nnedi3(field=-2))
SourceFiltered = SourceFiltered.Yadifmod2(order=-1,mode=1,edeint=SourceFiltered.nnedi3(field=-2))
# filtering
# stacking horizontal for filter preview
# adjust color to RGB32 (for preview)
SourceFiltered = SourceFiltered.ConvertToRGB32(matrix="Rec601")
# adjust color to RGB32 (for preview)
Source = Source.ConvertToRGB32(matrix="Rec601")
StackHorizontal(Source, SourceFiltered)
PreFetch(2)
# setting output fps to 59.940fps
AssumeFPS(60000,1001)
#  output: color sampling RGB32@16, matrix: bt601, scantyp: progressive, luminance scale: limited
return last
on my system:
[codeClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
LoadPlugin("I:\INNOIN~1\32bit\AVISYN~1\LSMASHSource.dll")
LoadPlugin("I:\INNOIN~1\32bit\AVISYN~1\yadifmod2.dll")
LoadPlugin("I:\INNOIN~1\32bit\AVISYN~1\nnedi3.dll")
# loading source: C:\Users\Selur\Desktop\hotel._10bit.mov
#  color sampling YUY2@10, matrix: bt601, scantyp: bottom field first, luminance scale: limited
Source = LWLibavVideoSource("C:\Users\Selur\Desktop\HOTEL_~1.MOV",cache=false,format="YUV422P16", prefer_hw=0)
# current resolution: 720x486
# deinterlacing
SourceFiltered = Source
Source = Source.Yadifmod2(order=-1,mode=1,edeint=Source.nnedi3(field=-2))
SourceFiltered = SourceFiltered.Yadifmod2(order=-1,mode=1,edeint=SourceFiltered.nnedi3(field=-2))
# filtering
# stacking horizontal for filter preview
# adjust color to RGB32 (for preview)
SourceFiltered = SourceFiltered.ConvertToRGB32(matrix="Rec601")
# adjust color to RGB32 (for preview)
Source = Source.ConvertToRGB32(matrix="Rec601")
StackHorizontal(Source, SourceFiltered)
PreFetch(8)
# setting output fps to 59.940fps
AssumeFPS(60000,1001)
#  output: color sampling RGB32@16, matrix: bt601, scantyp: progressive, luminance scale: limited
return last[/code]
Well, I just want to be able to achieve the same result in Hybrid, that I can achieve using 2 lines of the Avisynth script posted above. What I have to do?
Reply
#8
Quote:Well, I just want to be able to achieve the same result in Hybrid, that I can achieve using 2 lines of the Avisynth script posted above. What I have to do?
a. Since you don't share the whole Script that you use in AvsPmod, there is no real way to compare.
b. You use the filter view with a filtered and unfiltered view in Hybrid which makes the script a lot more complicated.

First thing that pops to mind to get near, what might be your script in AvsPmod, would be to:
a. disable "Filtering->Filter view"
and
b. enabling "Filtering->Avisynth->Misc->Script->Disable MT"
but since I can't reproduce this here I still think it might be an issue with the dlls used by Hybrid and your system or some av/firewall tool running on your system.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#9
(02.02.2021, 06:19)Selur Wrote:
Quote:Well, I just want to be able to achieve the same result in Hybrid, that I can achieve using 2 lines of the Avisynth script posted above. What I have to do?
a. Since you don't share the whole Script that you use in AvsPmod, there is no real way to compare.
b. You use the filter view with a filtered and unfiltered view in Hybrid which makes the script a lot more complicated.

First thing that pops to mind to get near, what might be your script in AvsPmod, would be to:
a. disable "Filtering->Filter view"
and
b. enabling "Filtering->Avisynth->Misc->Script->Disable MT"
but since I can't reproduce this here I still think it might be an issue with the dlls used by Hybrid and your system or some av/firewall tool running on your system.

Cu Selur

You don't hear me:"I just want to be able to achieve the same result in Hybrid, that I can achieve using 2 lines of the Avisynth script posted above. What I have to do?"
You do have my original video.
You do have my processed "2 lines of the Avisynth script" video.
Just point me, please, what I have to do in order to get the same result using Hybrid. Can you achieve that using your above posted suggestions?

P.S. Just wondering"Since you don't share the whole Script that you use in AvsPmod, there is no real way to compare."
Well, here is the full script:
(take any of the input filters)
#FFmpegSource2("hotel_10bit.mov")
#LSMASHVideoSource("hotel_10bit.mov")
LWLibavVideoSource("hotel_10bit.mov")
ConvertToRGB24() #since we do have 10 bit
ConvertToYV12()

yadifmod2(mode=1, edeint=nnedi3(field=-2))
srestore(frate=23.976)
Reply
#10
The lines you posted:
yadifmod2(mode=1, edeint=nnedi3(field=-2))
srestore(frate=23.976)
and the lines Hybrid uses:
# deinterlacing
Yadifmod2(order=-1,mode=1,edeint=nnedi3(field=-2))
# removing ghosting
srestore(frate=23.976,omode=6)
are the same since 'order=-1' (http://avisynth.nl/index.php/Yadifmod2) and 'omode=6' (http://avisynth.nl/index.php/Srestore)
are default values, Hybrid just chooses to show.

Assuming your script in AvsPmod does explicitly load the plugins&co it uses you could open it as source in Hybrid.

All in all it sadly, it seems like this doesn't go anywhere and I am not capable of helping you.
-> Hybrid might not be the best tool to archive what you want.
MeGui might be more suited to you, since iirc. it allows you to edit the Avisynth script as you please. (not sure whether StaxRip allows this too)

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)