View Full Version : insert audio in this script
byme
6th November 2008, 22:07
I would like to insert audio in this script
LoadPlugin("C:\Documents and Settings\UP\Documenti\Edit Video\Filtri\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\Documents and Settings\UP\Documenti\Edit Video\Filtri\NicAudio\NicAudio.dll")
#
v = MPEG2Source("C:\Documents and Settings\UP\Documenti\Edit Video\Canale 5 - October 30 20 40 01.d2v")
a = v.FadeIO(Int(v.FrameRate() * 1))
a = a.Trim(1, -(a.FrameCount() - 1))
AudioDub(v, a)
how they can enter the audio maintaining the fade?
NicMPG123Source("C:\Documents and Settings\UP\Documenti\Edit Video\Canale 5 - October 30 20 40 01 Tc0 L2 2ch 48 256 DELAY -26ms.mp2")
mikeytown2
6th November 2008, 22:44
The order of your script is important, as well as your goals... what are the fades for right now? are you trying to fade the video only, audio only or both with the same value?
Generally I do this when loading a/v
#load sources
v = MPEG2Source("C:\Documents and Settings\UP\Documenti\Edit Video\Canale 5 - October 30 20 40 01.d2v")
a = NicMPG123Source("C:\Documents and Settings\UP\Documenti\Edit Video\Canale 5 - October 30 20 40 01 Tc0 L2 2ch 48 256 DELAY -26ms.mp2").DelayAudio(-0.026)
AudioDub(v, a)
#edit video
byme
6th November 2008, 23:31
audio only, in and out
with your script there is no audio fade
...
there is a way to maintain audio and video together with dgindex?
or there is a mpeg2 decoder that allows you to open in VirtualDub mpeg2 through avisynth? (I tried for example with Elecard, but the problem deinterlacing video)
in that case suffice the script that I posted, putting DirectShowSource instead of MPEG2Source
sorry for my english
Gavino
7th November 2008, 01:20
@byme - If I understand you correctly, this script will do what you want, inserting the separate audio with a 1 second fade in and out:
LoadPlugin("C:\Documents and Settings\UP\Documenti\Edit Video\Filtri\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\Documents and Settings\UP\Documenti\Edit Video\Filtri\NicAudio\NicAudio.dll")
#
v = MPEG2Source("C:\Documents and Settings\UP\Documenti\Edit Video\Canale 5 - October 30 20 40 01.d2v")
v = AudioDub(v, NicMPG123Source("C:\Documents and Settings\UP\Documenti\Edit Video\Canale 5 - October 30 20 40 01 Tc0 L2 2ch 48 256 DELAY -26ms.mp2"))
v = v.DelayAudio(-0.026)
a = v.FadeIO0(Int(v.FrameRate() * 1))
AudioDub(v, a)
I have also corrected the audio track length and allowed for the audio delay.
byme
7th November 2008, 01:45
ooo works!
you're a great :thanks:
I would ask one thing
This parameter DelayAudio(-0.026) must change every time?.. It is necessary? I tried to remove it and it works equally
kemuri-_9
7th November 2008, 01:57
DelayAudio shifts the audio track by the given number of seconds:
so -0.026 shifts it earlier by 26 milliseconds, a fairly small amount which is unnoticeable by most.
generally the delays will be determined by the DVD/material you're working with, so it will usually differ because of that.
Gavino
7th November 2008, 01:59
A difference of 0.026 seconds is scarcely noticeable, so you could leave it out in this case. But it's best to get into the habit of putting it in. Note that DGIndex helps you by putting the necessary delay in the audio file name.
byme
7th November 2008, 02:26
I understand
may be useful also the delay
thanks again for your help
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.