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 > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd June 2019, 18:53   #1  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Posts: 1,213
Need some help with a Vapoursynth script

When using an avisynth script for my encode all works
Code:
LoadPlugin("C:/Program Files (Portable)/dgdecnv/DGDecodeNV.dll")
DGSource("I:\xxxxx.dgi",  fieldop=0, fulldepth=True)

DGTelecide(mode=1, dthresh=3.5)
DGDecimate()

#####CROP#####
Crop(12, 60, -8, -60)

#####RESIZE#####
Spline64Resize(854, 370)

ConvertBits(10)
When using the vapoursynth equivalent I have problems
Vapoursynth Editor check says the script is fine but I can't even get vdub2 to load it
Code:
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin("C:/Program Files (Portable)/dgdecnv/DGDecodeNV.dll")
clip = core.dgdecodenv.DGSource(r'F:\xxxxx.dgi',  fieldop=0, fulldepth=True)

#####AVSCOMPAT#####
core.avs.LoadPlugin("C:/Program Files (Portable)/dgdecnv/DGDecodeNV.dll")

#####IVTC#####
clip = core.avs.DGTelecide(clip, mode=1, dthresh=3.5)
clip = core.avs.DGDecimate(clip)

#####CROP#####
clip=core.std.Crop(clip, left=12, right=8, top=60, bottom=60)

#####RESIZE#####
clip=core.resize.Spline36(clip=clip, width=854, height=370)

clip = core.resize.Point(clip, format=vs.YUV420P10)

clip.set_output()
Can someone help me find the problem

The reason I am trying to get the vpy script working is that when using 64 bit suptitle I get major artifacts during the appearance of the subtitle
I don't have a problem with ImageFile

Last edited by gonca; 23rd June 2019 at 18:56.
gonca is offline   Reply With Quote
Old 23rd June 2019, 19:15   #2  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Posts: 1,213
Been working on it and the problem seems to be the resize line
Gives resize error 1027
gonca is offline   Reply With Quote
Old 23rd June 2019, 19:20   #3  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Posts: 1,213
Some more googling and attempts to figure it out and I solved the issue
gonca is offline   Reply With Quote
Old 23rd June 2019, 20:41   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
and I solved the issue
Dont keep it quiet, what was it. [Perhaps 'clip=clip' where I'm guessin' clip is non optional (I dont speak snake)].
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 23rd June 2019, 21:22   #5  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
clip=clip is correct. Resize error 1027: image dimensions must be divisible by subsampling factor
If you change height to something like 372 then it should work.

But is height = 370 correct for YUV420P8? I can confirm that it works in avs, in VS not. Who is to blame?
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 23rd June 2019, 21:27   #6  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Interlaced should need mod4, progressive only mod2?

http://avisynth.nl/index.php/Crop#Crop_restrictions
sneaker_ger is offline   Reply With Quote
Old 23rd June 2019, 21:30   #7  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Posts: 1,213
The video is form an old DVD.
The DVD was soft pull down but the video was flagged interlaced (fake)
Interlaced cropping must be mod 4

Quote:
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin("C:/Program Files (Portable)/dgdecnv/DGDecodeNV.dll")
clip = core.dgdecodenv.DGSource(r'F:\xxxxx.dgi', fieldop=0, fulldepth=True)

#####AVSCOMPAT#####
core.avs.LoadPlugin("C:/Program Files (Portable)/dgdecnv/DGDecodeNV.dll")

#####IVTC#####
clip = core.avs.DGTelecide(clip, mode=1, dthresh=3.5)
clip = core.avs.DGDecimate(clip, cycle=5, keep=4)

#####CROP#####
clip=core.std.Crop(clip, left=12, right=8, top=60, bottom=60)

#####RESIZE#####
clip = core.std.SetFieldBased(clip, 0)
clip=core.resize.Spline36(clip=clip, width=854, height=370)

clip = core.resize.Point(clip, format=vs.YUV420P10)

clip.set_output()
The red parts are the changes
The SetFieldBased entry gets around the mod requirements for interlaced

This whole exercise is because 64 bit suptitle does some nasty things when the subtitle is showing, makes it look like I am using 50kb/s

Last edited by gonca; 23rd June 2019 at 21:34.
gonca is offline   Reply With Quote
Old 23rd June 2019, 21:40   #8  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Posts: 1,213
Quote:
Originally Posted by StainlessS View Post
Dont keep it quiet, what was it. [Perhaps 'clip=clip' where I'm guessin' clip is non optional (I dont speak snake)].
I don't speak it well either, actually I just mumble a lot.
That is why it takes me longer and I have to ask for help for vpy and avs+ scripts

And I still don't get any notifications
Maybe some is giving me a hint
gonca is offline   Reply With Quote
Old 23rd June 2019, 21:45   #9  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Quote:
Originally Posted by sneaker_ger View Post
Interlaced should need mod4, progressive only mod2?

http://avisynth.nl/index.php/Crop#Crop_restrictions
Ahh yes, a progressive clip with height=370 works in VS, interlaced also if you set the field core.std.SetFieldBased(clip, 0).
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 23rd June 2019, 22:32   #10  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Posts: 1,213
Quote:
Originally Posted by ChaosKing View Post
Ahh yes, a progressive clip with height=370 works in VS, interlaced also if you set the field core.std.SetFieldBased(clip, 0).
To be more specific
This was a 720x480 16:9 with letterboxing
I removed the black bars and resized so I could use a SAR of 1:1
so I don't have to rely on a media player being able to recognize the DAR in a mkv container

I was using a progressive clip, which had fake interlaced flags
gonca 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 19:39.


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