PDA

View Full Version : DVD Rebuilder and avisynth error


gtaylor
28th January 2009, 04:35
Hi all,
I'm trying to use DVD Rebuilder Pro with an avisynth script to make a better version of the non anamphoric Star Wars dvd from Lucasfilm and am running into an issue. This script was written by G-Force on the Original Trilogy forums. Severall other there have got this to run great, but using DVD Rebuilder I am unable to get it to work. Using DVD Rebuilder 1.28, HCEncoder .23, Avisynth 2.5.8. When I run the encoder, HCencoder fails with the error "Script error: end of file reached without matching }". Eventually HCEncoder will abort. I also own CCE Basic and it doesn't crash but the encode runs in like 3 minutes so it's not doing anything. When I run this using manual tools and the HC Encoder GUI version, it completes the encoding. Takes about a week, but does the does the full encode. So I'm trying to find out why this doesn't work with DVD Rebuilder and two different encoders, but will work when doing the GUI version of HCEncoder? Here is the current.avs file:

#------------------
# AVS File Created by DVD Rebuilder
# VOBID:01, CELLID:07
#------------------
LoadPlugin("C:\Program Files\DVD-RB PRO\DGDecode.dll")
mpeg2source("D:\DVDWORK\D2VAVS\V01.D2V",idct=3)
#######################################################################################
############################ GOUT Filter By G-force V.3.17 ############################
#######################################################################################
########## setup stage
sw_frame_no = 689 # <-----Enter number of first frame of "Star Wars" logo
PAL = false # <-----Set to false for NTSC, true for PAL
Mpeg2Source("C:\Program Files\AviSynth 2.5\Scripts\VTS_03_1.d2v") # <-----Set path
########## cut off some of the black bars for faster processing (but keep mod 16)
PAL==false ? Crop(0,96,0,-96,align=true) : Crop(0,120,0,-120,align=true).AddBorders(8,0,8,0)
########## set black level/gamma, saturation/hue
Levels(10,1.13,255,0,255)
Tweak(sat=1.08,hue=-4)
########## global motion stabilization stage
temp = last.TemporalSoften(7,255,255,25,2)
Interleave(temp.Repair(last.TemporalSoften(1,255,255,25,2)),last)
DePan(last,data=DePanEstimate(last,trust=0,dxmax=1,dymax=0),offset=-1)
SelectEvery(2,0)
########## local motion stabilization/degrain stage
source = last
sigma = 5
filt = source.fft3dfilter(sigma=sigma,sigma2=sigma*.75,sigma3=sigma*.5,sigma4=sigma*.25,bt=5,sharpen=.3)
Median1(source.RemoveGrain(12),temp,filt)
fw_vec2 = last.MVAnalyse(isb=false,delta=2,pel=2,sharp=1,overlap=4,plevel=0,idx=1,dct=1)
fw_vec1 = last.MVAnalyse(isb=false,delta=1,pel=2,sharp=1,overlap=4,plevel=0,idx=1,dct=1)
bw_vec1 = last.MVAnalyse(isb=true, delta=1,pel=2,sharp=1,overlap=4,plevel=0,idx=1,dct=1)
bw_vec2 = last.MVAnalyse(isb=true, delta=2,pel=2,sharp=1,overlap=4,plevel=0,idx=1,dct=1)
source.MVDegrain2(bw_vec1,fw_vec1,bw_vec2,fw_vec2,thSAD=400,idx=2)
Median1(source,last,filt,chroma="copy first")
last.MVDegrain2(bw_vec1,fw_vec1,bw_vec2,fw_vec2,thSAD=300,thSCD1=150,thSCD2=75,idx=3)
########## sharpening
Contra(last,source)
########## restore stars stage
prest = last
prest.MT_Binarize(threshold=20,upper=true).MT_Expand()
MT_Merge(prest,source,last,chroma="copy first")
########## additional "Lucasfilm" and "Along time ago..." stabilization
########## DELETE THE NEXT LINE IF USING ON ESB OR ROTJ as I have not yet determined the correct frame numbers for those
prest.Trim(0,sw_frame_no-425)++prest.Trim(sw_frame_no-424,sw_frame_no-1).TemporalSoften(3,255,255,25,2)++last.Trim(sw_frame_no,0)
########## anti-aliasing
last.EEDI2().Repair(last.NNEDI(dh=true,field=1),9)
########## resize to 16x9 AR, remove sides, add borders
PAL==false ? Spline16Resize(720,384).Crop(8,8,-4,-12,align=true).AddBorders(6,58,6,58)
\ : Spline16Resize(736,448).Crop(12,6,-12,-8, align=true).AddBorders(4,70,4,72)
########## subtitle stage
delay = sw_frame_no-689
f = "Franklin Gothic Medium Cond"
f_col = $ffffff
f_wid = 10
f_pos = PAL==false ? 464 : 557
f_siz = PAL==false ? 38 : 46
Subtitle ("Going somewhere, Solo?",
\ -1,f_pos,70663+delay,70698+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("It’s too late. You should have paid him when you had the chance.",
\ -1,f_pos,70825+delay,70931+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("Jabba’s put a price on your head so large...",
\ -1,f_pos,70940+delay,71005+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("...every bounty hunter in the galaxy will be looking for you.",
\ -1,f_pos,71014+delay,71088+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("I’m lucky I found you first.",
\ -1,f_pos,71098+delay,71137+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("If you give it to me, I might forget I found you.",
\ -1,f_pos,71203+delay,71282+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("Jabba’s through with you.",
\ -1,f_pos,71365+delay,71406+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("He has no time for smugglers...",
\ -1,f_pos,71435+delay,71489+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("...who drop their shipments at the first sign of an Imperial cruiser.",
\ -1,f_pos,71498+delay,71595+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("You can tell that to Jabba. He may only take your ship.",
\ -1,f_pos,71656+delay,71748+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("That’s the idea.",
\ -1,f_pos,71806+delay,71833+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("I’ve been looking forward to this for a long time.",
\ -1,f_pos,71843+delay,71931+delay,f,f_siz,f_col,font_width=f_wid)
#######################################################################################
Function Contra(clip denoised, clip orig)
{# re-write of Didée's contra sharpening routine from TemporalDegrain.avs
Interleave(denoised,denoised.RemoveGrain(12,-1),denoised.RemoveGrain(4,-1))
Clense(reduceflicker=false,grey=true)
SelectEvery(3,1)
MT_MakeDiff(last,last.RemoveGrain(12,-1).RemoveGrain(12,-1))
last.Repair(MT_MakeDiff(orig,denoised),1,-1).MT_LUTxy(last,"x 128 - abs y 128 - abs < x y ?")
denoised.MT_AddDiff(last,chroma="copy first")
Return(last)
#######################################################################################
Function Median1(clip input_1, clip input_2, clip input_3, string "chroma")
{# median of 3 clips from Helpers.avs by G-force
chroma = default(chroma,"process") #default is "process". Alternates: "copy first" or "copy second"
Interleave(input_1,input_2,input_3)
chroma == "process" ? Clense(reduceflicker=false) : Clense(reduceflicker=false,grey=true)
SelectEvery(3,1)
chroma == "copy first" ? last.MergeChroma(input_1) : chroma == "copy second" ? last.MergeChroma(input_2) : last
trim(16344,22143)
ConvertToYV12()

Sorry for the long post, but I'm really at a loss on this one. Thanks

neuron2
28th January 2009, 04:40
Your script is missing all the closing braces } on the functions!

gtaylor
28th January 2009, 05:22
Your script is missing all the closing braces } on the functions!

Thanks, I appreciate your help and response. What I posted was the contents of the actual current.avs file. This is what I post in to the actual filter editor in DVD Rebuilder and I see it does have some closing braces, perhaps it needs more?

#######################################################################################
############################ GOUT Filter By G-force V.3.17 ############################
#######################################################################################
########## setup stage
sw_frame_no = 689 # <-----Enter number of first frame of "Star Wars" logo
PAL = false # <-----Set to false for NTSC, true for PAL
Mpeg2Source("C:\Program Files\AviSynth 2.5\Scripts\VTS_03_1.d2v") # <-----Set path

########## cut off some of the black bars for faster processing (but keep mod 16)
PAL==false ? Crop(0,96,0,-96,align=true) : Crop(0,120,0,-120,align=true).AddBorders(8,0,8,0)

########## set black level/gamma, saturation/hue
Levels(10,1.13,255,0,255)
Tweak(sat=1.08,hue=-4)

########## global motion stabilization stage
temp = last.TemporalSoften(7,255,255,25,2)
Interleave(temp.Repair(last.TemporalSoften(1,255,255,25,2)),last)
DePan(last,data=DePanEstimate(last,trust=0,dxmax=1,dymax=0),offset=-1)
SelectEvery(2,0)

########## local motion stabilization/degrain stage
source = last
sigma = 5
filt = source.fft3dfilter(sigma=sigma,sigma2=sigma*.75,sigma3=sigma*.5,sigma4=sigma*.25,bt=5,sharpen=.3)

Median1(source.RemoveGrain(12),temp,filt)

fw_vec2 = last.MVAnalyse(isb=false,delta=2,pel=2,sharp=1,overlap=4,plevel=0,idx=1,dct=1)
fw_vec1 = last.MVAnalyse(isb=false,delta=1,pel=2,sharp=1,overlap=4,plevel=0,idx=1,dct=1)
bw_vec1 = last.MVAnalyse(isb=true, delta=1,pel=2,sharp=1,overlap=4,plevel=0,idx=1,dct=1)
bw_vec2 = last.MVAnalyse(isb=true, delta=2,pel=2,sharp=1,overlap=4,plevel=0,idx=1,dct=1)

source.MVDegrain2(bw_vec1,fw_vec1,bw_vec2,fw_vec2,thSAD=400,idx=2)

Median1(source,last,filt,chroma="copy first")

last.MVDegrain2(bw_vec1,fw_vec1,bw_vec2,fw_vec2,thSAD=300,thSCD1=150,thSCD2=75,idx=3)

########## sharpening
Contra(last,source)

########## restore stars stage
prest = last
prest.MT_Binarize(threshold=20,upper=true).MT_Expand()
MT_Merge(prest,source,last,chroma="copy first")

########## additional "Lucasfilm" and "Along time ago..." stabilization
########## DELETE THE NEXT LINE IF USING ON ESB OR ROTJ as I have not yet determined the correct frame numbers for those
prest.Trim(0,sw_frame_no-425)++prest.Trim(sw_frame_no-424,sw_frame_no-1).TemporalSoften(3,255,255,25,2)++last.Trim(sw_frame_no,0)

########## anti-aliasing
last.EEDI2().Repair(last.NNEDI(dh=true,field=1),9)

########## resize to 16x9 AR, remove sides, add borders
PAL==false ? Spline16Resize(720,384).Crop(8,8,-4,-12,align=true).AddBorders(6,58,6,58)
\ : Spline16Resize(736,448).Crop(12,6,-12,-8, align=true).AddBorders(4,70,4,72)

########## subtitle stage
delay = sw_frame_no-689
f = "Franklin Gothic Medium Cond"
f_col = $ffffff
f_wid = 10
f_pos = PAL==false ? 464 : 557
f_siz = PAL==false ? 38 : 46

Subtitle ("Going somewhere, Solo?",
\ -1,f_pos,70663+delay,70698+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("It’s too late. You should have paid him when you had the chance.",
\ -1,f_pos,70825+delay,70931+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("Jabba’s put a price on your head so large...",
\ -1,f_pos,70940+delay,71005+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("...every bounty hunter in the galaxy will be looking for you.",
\ -1,f_pos,71014+delay,71088+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("I’m lucky I found you first.",
\ -1,f_pos,71098+delay,71137+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("If you give it to me, I might forget I found you.",
\ -1,f_pos,71203+delay,71282+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("Jabba’s through with you.",
\ -1,f_pos,71365+delay,71406+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("He has no time for smugglers...",
\ -1,f_pos,71435+delay,71489+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("...who drop their shipments at the first sign of an Imperial cruiser.",
\ -1,f_pos,71498+delay,71595+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("You can tell that to Jabba. He may only take your ship.",
\ -1,f_pos,71656+delay,71748+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("That’s the idea.",
\ -1,f_pos,71806+delay,71833+delay,f,f_siz,f_col,font_width=f_wid)
Subtitle ("I’ve been looking forward to this for a long time.",
\ -1,f_pos,71843+delay,71931+delay,f,f_siz,f_col,font_width=f_wid)

#######################################################################################
Function Contra(clip denoised, clip orig)
{# re-write of Didée's contra sharpening routine from TemporalDegrain.avs

Interleave(denoised,denoised.RemoveGrain(12,-1),denoised.RemoveGrain(4,-1))
Clense(reduceflicker=false,grey=true)
SelectEvery(3,1)

MT_MakeDiff(last,last.RemoveGrain(12,-1).RemoveGrain(12,-1))
last.Repair(MT_MakeDiff(orig,denoised),1,-1).MT_LUTxy(last,"x 128 - abs y 128 - abs < x y ?")

denoised.MT_AddDiff(last,chroma="copy first")

Return(last)
}

#######################################################################################
Function Median1(clip input_1, clip input_2, clip input_3, string "chroma")
{# median of 3 clips from Helpers.avs by G-force

chroma = default(chroma,"process") #default is "process". Alternates: "copy first" or "copy second"

Interleave(input_1,input_2,input_3)
chroma == "process" ? Clense(reduceflicker=false) : Clense(reduceflicker=false,grey=true)
SelectEvery(3,1)

chroma == "copy first" ? last.MergeChroma(input_1) : chroma == "copy second" ? last.MergeChroma(input_2) : last

Return(last)
}

neuron2
28th January 2009, 05:32
That looks better. What error do you get with that?

gtaylor
28th January 2009, 05:57
That looks better. What error do you get with that?


I get "end of file reached without matching }" Odd that the current.avs file takes all of this out and also removes some of the subtitle text. Not really sure what to make of it. I know the script is good and that I have all plugins as if I run HC Encoder GUI version it encodes and runs. Just won't through DVD Rebuilder. Thanks for your help, I really appreciate it.

neuron2
28th January 2009, 06:03
Make sure you have a line feed after the last } in the file. That's all I can think of.

steptoe
28th January 2009, 16:00
I found that for some reason, or its just me, that DVD-RB fails with scripts unless you explicitly tell it to load each DLL filter or functions

Never had a script fail after using that method, once I get all the required filters and functions that a script I'm playing with needs to work

Use the LoadPlugin for each filter .DLL and then change any functions that claim to autoload from .avsi to .avs and then load that using Import and you can than guantee that you have everything that the script needs. Relying on autoloading filters and functions doesn't always work, so I tell AviSynth what I want loaded and everything works everytime

E.G.

This is my script to get the amazing, but also amazingly slow denoise, degrain, despot and plenty more 'de' besides function MCTemporalDenoise

SetMTMode(2,8)
SetMemoryMax(512)

LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\AddGrain.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\DeBlock.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\EEDI2.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\FFT3DFilter.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\FFT3DGPU.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\GradFun2DB.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\MT_MaskTools-26.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\MVTools2.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\RemoveGrain.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\Repair.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\RSharpen.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\SangNom.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\TTempSmooth.dll")

Import("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\DeBlock_QED.avs")
Import("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\LSFMOD.avs")
Import("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\MCTemporalDenoise.avs")

MCTemporalDenoise(settings="medium",GPU=TRUE)


I keep all my functions separate, yes it means duplicating common filters but also means I can trace any filter errors as some require very specific versions of a filter or function to work correctly, if you have a common folder for all your filters and functions which is the default, then things get confusing very fast

gtaylor
28th January 2009, 16:09
I found that for some reason, or its just me, that DVD-RB fails with scripts unless you explicitly tell it to load each DLL filter or functions

Never had a script fail after using that method, once I get all the required filters and functions that a script I'm playing with needs to work

Use the LoadPlugin for each filter .DLL and then change any functions that claim to autoload from .avsi to .avs and then load that using Import and you can than guantee that you have everything that the script needs. Relying on autoloading filters and functions doesn't always work, so I tell AviSynth what I want loaded and everything works everytime

E.G.

This is my script to get the amazing, but also amazingly slow denoise, degrain, despot and plenty more 'de' besides function MCTemporalDenoise

SetMTMode(2,8)
SetMemoryMax(512)

LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\AddGrain.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\DeBlock.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\EEDI2.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\FFT3DFilter.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\FFT3DGPU.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\GradFun2DB.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\MT_MaskTools-26.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\MVTools2.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\RemoveGrain.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\Repair.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\RSharpen.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\SangNom.dll")
LoadPlugin("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\TTempSmooth.dll")

Import("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\DeBlock_QED.avs")
Import("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\LSFMOD.avs")
Import("C:\Program Files\Applications\Video\AviSynth\-functions\MCTemporalDenoise\MCTemporalDenoise.avs")

MCTemporalDenoise(settings="medium",GPU=TRUE)


I keep all my functions separate, yes it means duplicating common filters but also means I can trace any filter errors as some require very specific versions of a filter or function to work correctly, if you have a common folder for all your filters and functions which is the default, then things get confusing very fast

Thanks guys, I'll give these suggestions a try. I appreciate it.

gtaylor
29th January 2009, 04:25
Thanks guys, I'll give these suggestions a try. I appreciate it.

Thanks for the input guys. Still getting the errors. I think I am just going to give up trying to use DVD Rebuilder for this.