Log in

View Full Version : AVS script m2v file trouble


budinst
18th December 2008, 00:01
Hi,
input jkm_8_12_2008.m2v + jkm_8_12_2008_1.wav and jkm_8_12_2008_2.wav
I open m2v ( DGIndex-brilliant) >> make HDV.d2v >>>make avs script and use VirtualDub

#START AVS script
LoadPlugin("C:\Program Files\GordianKnot\DGMPGDec\DGDecode.dll")
LoadVirtualDubPlugin("E:\instalki_\VirtualDub-1.7.1\plugins\logo17b2\Logo.vdf", "Logo", 0)
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\decomb.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\UnDot.dll")

MPEG2Source("G:\jkm_8_12_2008.d2v")
LanczosResize(1280,720) # Lanczos (Sharp)
video=MPEG2Source("G:\jkm_8_12_2008.d2v")

Tweak(bright=10) #

# DEINTERLACING (1)
#FieldDeinterlace()
FieldDeinterlace(blend=false)
#TomsMoComp(1,5,1)

# DENOISING: choose one combination (or none)
Undot()

audio1 = WAVSource("G:\jkm_8_12_2008_1.wav")
audio2 =WAVSource("G:\jkm_8_12_2008_2.wav")
stereo = MergeChannels(audio1,audio2) # STEREO!
return AudioDub(video, stereo)

Trim(117,3254,false)

#Fade
FadeIn(30)

#Dissove clips, add subtitle
clip1=Trim(0, 110)
clip2=Trim(61, 250).Subtitle("9 grudnia 2008", font="Verdana", size=32, text_color=$FFE87C, x=120, y=660)
clip3=Trim(201, 999999999)
Dissolve(clip1, clip2, clip3, 50)

ConvertToRGB()
Logo(1180, 50, 95, 1, 0, 0, 0, 0, "E:\logo_przezr_rozmiar4.BMP", 0, 125, 200, 0, 0, 9400, 130)
Logo(1180, 50, 95, 1, 0, 0, 0, 0, "E:\logo_przezr_rozmiar4.BMP", 0, 400, 3100, 0, 0, 9400, 3100)
ConvertToYV12()

FadeOut(30)

#END

Hmm not work here:
LanczosResize(1280,720)
Trim(117,3254,false) ( trim audio and video)
subtitle
logo
DEINTERLACING
Tweak
DENOISING

When I remove this audio segment :

audio1 = WAVSource("G:\jkm_8_12_2008_1.wav")
audio2 =WAVSource("G:\jkm_8_12_2008_2.wav")
stereo = MergeChannels(audio1,audio2) # STEREO!
return AudioDub(video, stereo)

All works corretly.

What I want?

1) load movie + audio (two wav file to stereo)
2) Trim audio and movie start and end of movie
3) save wav (stereo audio file -trimmed )
4) compress video (VirtualDub) (here use : logo , subtitle and other function) -
5) mux compressed video and wav audio with NanDub

any sugestion?

hanfrunz
18th December 2008, 10:56
Do you get an errormessage, and if which one?

budinst
18th December 2008, 12:10
script is full of bugs

2Bdecided
18th December 2008, 13:04
I'm guessing you're new to AVIsynth and this is based on a template script? If so, here's some help...

Lines of AVIsynth script which don't start with some_variable_name=some_function will put the output of that line into a variable called "last".
Lines of AVIsynth script which don't say which video they are processing will use the variable "last" as an input.

So, if you don't have any "=" in your script, you process one video, always automatically storing it in the variable "last".

Your first problem is that you do most things to the default "last" video stream, but also load a stream into the variable "video" which you then never process.

Your second "problem" is that you're using "return" - that tells AVIsynth to return the value at that point - the rest of the script won't ever be used!

Try something like this...
#START AVS script
LoadPlugin("C:\Program Files\GordianKnot\DGMPGDec\DGDecode.dll")
LoadVirtualDubPlugin("E:\instalki_\VirtualDub-1.7.1\plugins\logo17b2\Logo.vdf", "Logo", 0)
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\decomb.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\UnDot.dll")

MPEG2Source("G:\jkm_8_12_2008.d2v")
LanczosResize(1280,720) # Lanczos (Sharp)

Tweak(bright=10) #

# DEINTERLACING (1)
#FieldDeinterlace()
FieldDeinterlace(blend=false)
#TomsMoComp(1,5,1)

# DENOISING: choose one combination (or none)
Undot()

audio1 = WAVSource("G:\jkm_8_12_2008_1.wav")
audio2 =WAVSource("G:\jkm_8_12_2008_2.wav")
stereo = MergeChannels(audio1,audio2) # STEREO!

AudioDub(last, stereo)

Trim(117,3254,false)

#Fade
FadeIn(30)

#Dissove clips, add subtitle
clip1=Trim(0, 110)
clip2=Trim(61, 250).Subtitle("9 grudnia 2008", font="Verdana", size=32, text_color=$FFE87C, x=120, y=660)
clip3=Trim(201, 999999999)
Dissolve(clip1, clip2, clip3, 50)

ConvertToRGB()
Logo(1180, 50, 95, 1, 0, 0, 0, 0, "E:\logo_przezr_rozmiar4.BMP", 0, 125, 200, 0, 0, 9400, 130)
Logo(1180, 50, 95, 1, 0, 0, 0, 0, "E:\logo_przezr_rozmiar4.BMP", 0, 400, 3100, 0, 0, 9400, 3100)
ConvertToYV12()

FadeOut(30)
I don't know if that will do what you want, but it's removed the two problems I described above.

Hope this helps.

Cheers,
David.

budinst
18th December 2008, 13:42
Wow!
work perfectly !
I translate all and respond more.
Best Regards
Andrzej Wayda

budinst
19th December 2008, 00:17
Yes I'm new in AVIsynth and realy I used template script's .For me it is clearl how to find the end of segment ( early Fortran software)
this "last" video stream really shows when to add audio and later trimm Video and audio.. Thanks .
I need the "last" when I want to add two other movies, one insert before and other insert after precessed segment ( movie1.avi and movie2.avi ). How to dissolve this ? movie1.avi and movie2.avi have audio (wav) and same size (1280 x 720) or other. . How to make it ?

Regards Andrzej