Total noob here. Had the following script to edit SD clips in the past:
**********
Loadcplugin("c:\program files\avisynth 2.5\plugins\yadif.dll")
Clip1=DirectShowSource("M:\UnconvertedVideo\Clip 017.m2t").Trim(160,320)
Clip2=DirectShowSource("M:\UnconvertedVideo\Clip 015.m2t").Trim(50,350)+Trim
Dissolve(clip1,clip2,10)
yadif()
**********
Now trying to use same scipt on HD clips (*.m2t) files. VirtualDub doesn't load this script.
My questions:
1.Why doesn't VirtualDub load my script?
2.Which filter do you recommend for voiceovers (to replace original bad audio) and what would be its usage?
+ Reply to Thread
Results 1 to 30 of 40
-
-
1.These are HDV clips.
2.Have neither haali media splitter nor ffdshow installed. Only have VirtualDub and AviSynth with some filters.
3.VirtualDub says: Script error:Invalid arguments fo function "Trim", (clip location, line number)
If I load one individual clip at a time and trim it, no errors. Example:
*********
DirectShowSource("M:\UnconvertedVideo\Clip 017.m2t").Trim(160,320)
*********
So it's something pertaining to using the trim command on a batch of clips and trying to splice them together. But what? -
get rid of the +trim at the end of clip2 , or add arguments to it (you have empty brackets)
Clip2=DirectShowSource("M:\UnconvertedVideo\Clip 015.m2t").Trim(50,350)
instead of
Clip2=DirectShowSource("M:\UnconvertedVideo\Clip 015.m2t").Trim(50,350)+Trim -
Note that audiodub won't do a voice over, it will only replace the entire audio track. It wasn't clear in your earlier post if you had already prepared the voiceover in another program.
-
this worked, but it's very time consuming.
************************************
Clip1=DirectShowSource("E:\UnconvertedVideo\Hiking with Tim Jorgensen 06-08\Clip 015.m2t").Trim(50,350)
Clip2=DirectShowSource("E:\UnconvertedVideo\Hiking with Tim Jorgensen 06-08\Clip 015.m2t").Trim(600,1600)
Clip3=DirectShowSource("E:\UnconvertedVideo\Hiking with Tim Jorgensen 06-08\Clip 015.m2t").Trim(1780,2010)
Dissolve(clip1,clip2,clip3,10)
*****************************************
Question Remains: How does one do multiple 'trim' in one command line on any one individual clip?
Last edited by PapaDmitry; 8th Jun 2010 at 20:48.
-
"Just doesn't work" doesn't cut it. What's the error message?
In your case, it's probably the gap between numbers in your second line.
Clip2.Trim(178 0,2010) -
it's the way it pasted. There's no gap in the script. Here's what worked:
I did this (assigning multiple clip #'s to each part of the clip I want to trim). It worked, but very time consuming.
************************************************** ******************************
Clip1=DirectShowSource("E:\UnconvertedVideo\Hiking with Tim Jorgensen 06-08\Clip 015.m2t").Trim(50,350)
Clip2=DirectShowSource("E:\UnconvertedVideo\Hiking with Tim Jorgensen 06-08\Clip 015.m2t").Trim(600,1600)
Clip3=DirectShowSource("E:\UnconvertedVideo\Hiking with Tim Jorgensen 06-08\Clip 015.m2t").Trim(1780,2010)
Dissolve(clip1,clip2,clip3,10)
************************************************** *******************************
Note that I have to treat each 'trim'of the same clip as a separate clip number. More work, but it works.
What I would like to know is how to combine them all? How to make more neat? -
Use "CODE" tags (the # button on the formatting bar) when you are posting code.
First, put the AVS script in the same folder as your source files, then you don't need the complete paths.
And all the clips are from the same source, you only need to load it once. The Trims and most other functions work implicitly on whatever is the current clip (called "last" if you need to use it by name).
Code:DirectShowSource("Clip 015.m2t") Clip1=Trim(50,350) Clip2=Trim(600,1600) Clip3=Trim(1780,2010) Dissolve(Clip1,Clip2,Clip3,10)
Code:DirectShowSource("Clip 015.m2t") Dissolve(Trim(50,350),Trim(600,1600),Trim(1780,2010),10)
Otherwise, I've never used it but there is a Gui for this kind of editing :avsFilmCutter
The excellent script editor AvsP also has a Trim editor.
(New version here: http://forum.doom9.org/showthread.php?t=153248 )
See this guide, especially page 4-5.Last edited by AlanHK; 9th Jun 2010 at 02:56.
-
Thanks.
How to integrate Audiodub filter code into my script? I want to replace audio on one of my trimmed clips.
Had there been only one clip, I assume the script would be like this?
Code:video=DirectShowSource("F:\Clip 017.m2t").Trim(160,320) audio=WAVSource("F:\track17.wav") Audiodub(video,audio)
Code:Loadcplugin("c:\program files\avisynth 2.5\plugins\yadif.dll") Clip1=DirectShowSource("F:\Clip 017.m2t").Trim(160,320) Clip2=DirectShowSource("F:\Clip 015.m2t").Trim(50,350) Dissolve(clip1,clip2,10) yadif()
Last edited by PapaDmitry; 9th Jun 2010 at 16:11.
-
Let's assume you want to replace the audio on clip1 only.
Then you could do it like this:
Code:Loadcplugin("c:\program files\avisynth 2.5\plugins\yadif.dll") audio=WAVSource("F:\track17.wav") Clip1=DirectShowSource("F:\Clip 017.m2t").Trim(160,320).AudioDub(audio) Clip2=DirectShowSource("F:\Clip 015.m2t").Trim(50,350) Dissolve(clip1,clip2,10) yadif()
If the new audio is the full length, put AudioDub(...) before the Trim(...) rather than after. -
Thanks. The code works:
Code:audio = MPASource("F:\clip 31.mp3", normalize=false) clip1 = DirectShowSource("F:\Clip 031.m2t").AudioDub(audio).DelayAudio(-3.0) audio = MPASource("F:\clip 57.mp3", normalize=false) clip2 = DirectShowSource("F:\Clip 057.m2t").AudioDub(audio).DelayAudio(-1.47) Dissolve(clip1,clip2,3)
-
You can use BlankClip() and Subtitle() to do this, eg
Code:clip1 = ... clip2 = ... trans = BlankClip(clip1, length=25).Subtitle("Clip2 coming up...") clip1+trans+clip2 # or use Dissolve(clip1, trans, clip2, 3)
-
okay, I'm making some progress, but a new issue came up. Using the code below I must've joined some ten or so audio and video clips and began noticing that some audio clips get cut-off midway through playback.
Code:audio = MPASource("F:\clip 31.mp3", normalize=false) clip1 = DirectShowSource("F:\Clip 031.m2t").AudioDub(audio).DelayAudio(-3.0)
-
Question: do the audio and video clips have to be same length (in seconds I mean)? What happens when my audio clip is longer than my video clip? Is there code to correct the difference in clip length if that is even necessary?
Don't use directshowsource(). It's not necessary frame accurate and inconsistent as it depends on your system installed codecs and filters
For HDV (MPGE2) sources, I would use DGIndex and MPEG2Source(), which indexes your file and is frame accurate & more consistent
The A/V length has to be the same, other wise the "overhang" will displace joined clips and you will get desync. You can use Trim() on a audiodub() clip to cut ends to make them flush
I would use aligned splice (++) instead of unaligned splice(+) e.g. clip1++clip2 , instead of clip1+clip2 -
I would use DGIndex and MPEG2Source()
You can use Trim() on a audiodub() clip to cut ends to make them flushCode:AudioDub(audio).DelayAudio(-3.0).Trim()
-
There are instructions included in the DGIndex zip file. To summarize, index your file with DGIndex, and use MPEG2Source("video.d2v"). That would replace DirectShowSource("video.m2t")
It will demux the audio and write the delay value in the name. That value is what you would use for the DelayAudio()
You can use Trim() on a audiodub() clip to cut ends to make them flushCode:AudioDub(audio).DelayAudio(-3.0).Trim()
e.g. Trim(0,1000) would cut a clip from frames 0-1000 . If you had "overhanging" audio or video, it would be cut off.Last edited by poisondeathray; 21st Jun 2010 at 16:36.
-
Depends what you mean by that.
Anything (video or audio) beyond frame 1000 will clearly be cut off.
If the audio ends before frame 1000, it will be padded with silence up to frame 1000, unless you also specify pad_audio=false, in which cast the overhang is left in. -
I find a useful trick is to use
Code:Trim(0,0)
For some reason when I load some AVI files with AviSource the audio appears to be seconds, minutes, even hours, longer than the video, this makes it an exact match. It seems to pad out any shortfall with silence, but I haven't really confirmed that.Last edited by AlanHK; 21st Jun 2010 at 21:40.
-
-
Let's suppose I have two clips joined with a blank transition inbetween like so:
Code:Clip1 = DirectShowSource("F:\Clip 1.m2t") Clip2 = DirectShowSource("F:\Clip 2.m2t") Trans = Blankclip(clip1, length=100).Subtitle("Whatever", size=58, align=5) clip1+trans+clip2
Question 2: What is the usage of Subtitle for both clips in the script above at specific frame locations and if subtitles are more than one line long?Last edited by PapaDmitry; 24th Jun 2010 at 17:34.
-
Code:
DirectShowSource("F:\Clip 1.m2t") Blankclip(last, length=100).Subtitle("intro text", size=58, align=5)++last last ++Blankclip(last, length=100).Subtitle("Whatever001", size=58, align=5) last ++DirectShowSource("F:\Clip 2.m2t")
http://avisynth.org/mediawiki/Subtitle
Multi-line text using "\n" is added in v2.57 and it is used if the lsp (line spacing) parameter is set. It sets the additional line space between two lines in 0.125 pixel units.Code:Subtitle("Text line 1\nText line 2", lsp=10, first_frame =100, last_frame=200)
Last edited by AlanHK; 24th Jun 2010 at 21:11. Reason: corrected error
-
Since you have no longer defined clip1, this should be
last ++Blankclip(last, length=100).Subtitle("Whatever001", size=58, align=5)
Also note that when using \n, you can set lsp=0 to get 'normal' line spacing, ie it must be set to something to support \n, but that something can be zero. -
Thanks, corrected.
As for lsp, that was just an arbitrary figure. But zero leading isn't "normal", that's the absolute minimum, very tight, normal text has leading about 20% of the pointsize. Depends on the font. If it's being used as a title on a blank frame, no need to squeeze it.Last edited by AlanHK; 24th Jun 2010 at 21:16.
-
Good point.
I was just clarifying that there is a difference between setting lsp=0 (which allows \n) and not setting it at all (which doesn't). -
Yeah, previous versions didn't have multiple lines, so lsp also serves as a flag instead of having a sensible default.
Code:Subtitle("Text line 1\nText line 2")
I think that was overcautious myself, to use multiple lines you HAVE to set lsp now, to keep compatiblity with possible old scripts that used a literal "\n"; though I doubt any existed in reality. -
Check the screenshot. I'd like to display each line with a couple of seconds delay on the bottom to match to when my gf is actually saying them (versus clumped together at the same time). align=2 only displays one line at a time on the bottom. How is that done?
<img src="http://a03-b03.mypicturetown.com:80/P2PwebCmdController/cache/AO%3D5aqeMx2*NS.jpikl3I%...item.jpg?rot=1" title="" alt="" width="320"height="183">Last edited by PapaDmitry; 27th Jun 2010 at 23:12.
-
Because I don't now how to do that. Do you mind telling me how?
Last edited by PapaDmitry; 27th Jun 2010 at 22:56.
Similar Threads
-
Trimming with Avisynth: An exploration
By Krelmaneck in forum EditingReplies: 2Last Post: 22nd Oct 2010, 12:20 -
AviSynth Splicing Problems
By legocrazy1 in forum EditingReplies: 7Last Post: 13th Jul 2010, 23:15 -
splicing HD and SD formats together with AviSynth
By PapaDmitry in forum EditingReplies: 2Last Post: 5th Jul 2010, 05:25 -
Trimming the audio to go along with the video cuts in avisynth?
By mt123 in forum Newbie / General discussionsReplies: 0Last Post: 10th Jan 2010, 03:23 -
AVISynth splicing many AVCHD clips - is it possible?
By Redrussky in forum Video ConversionReplies: 4Last Post: 4th May 2008, 18:18