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."
01.02.2021, 22:05 (This post was last modified: 01.02.2021, 22:12 by Selur.)
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,..
(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,..
Have no issues to process this video using just 2 lines with AvsPmod and VirtualDub2, regardless input filter (FFmpegSource2(), LSMASHVideoSource(), LWLibavVideoSource()) :
(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,..
Have no issues to process this video using just 2 lines with AvsPmod and VirtualDub2, regardless input filter (FFmpegSource2(), LSMASHVideoSource(), LWLibavVideoSource()) :
02.02.2021, 05:49 (This post was last modified: 02.02.2021, 06:03 by Selur.)
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.
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?
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.
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()
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)