Quantcast Avisynth: Multiple Clips to one MPEG File? - digitalFAQ.com Forums [Archives]
  #1  
01-06-2005, 10:10 AM
the viking the viking is offline
Free Member
 
Join Date: Sep 2004
Location: Norway
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Just a question I didnt find a answer to on the avisynth pages:

Is it possible to add more than one movie clip in the
same script?The point is to get one mpeg file out of the clips.
And if yes,will it be something like this:
a=AviSource("C:\Movie 1.avi")
b=AviSource("C:\Movie 2.avi") and so on??

What about Trim()?
Let say I want the video in the first clip to go from frame 24 to 3452
and from 5678 to 12345

Is it possible?
and will the line be something like this:
a=trim(24,3452),(5678,12345)
b=trim(3333,888,(9999,9999) ??

--------------------
viking
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
01-06-2005, 10:35 AM
Latexxx Latexxx is offline
Free Member
 
Join Date: Jun 2002
Location: Tampere, Finland
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
You can do
a=avisource(...)
b=avisource(...)
or
avisource(...)+avisource(...)

and you can do

c=trim(a,100,200)+trim(a,500,700)+trim(b,500,1000)

I have a feeling that you can do
c=a.trim(100,200)+a.trim(500,700)+b.trim(500,1000)
but I'm not sure. But you can definately do

a = AVISource("d:\capture.00.avi")
b = AVISource("d:\capture.01.avi")
c = AVISource("d:\capture.02.avi")
sound_track = WAVSource("d:\audio.wav")
AudioDub(a+b+c, sound_track)
Reply With Quote
  #3  
01-06-2005, 10:36 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Nope! Trim() will do refer to the "last" video stream where ist applied and in your case it would be the ready merged streams so your cut point would be screwed up!

This is the way to go ...:

a=AviSource("C:\Movie 1.avi").trim(24,3452)++trim(5678,12345)
b=AviSource("C:\Movie 2.avi").trim(3333,8888)++trim(8889,9999)
return a+b

EDIT: aaaah Latexx was first :)
Reply With Quote
  #4  
01-06-2005, 10:42 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by the viking
Is it possible to add more than one movie clip in the
same script?The point is to get one mpeg file out of the clips.
And if yes,will it be something like this:
a=AviSource("C:\Movie 1.avi")
b=AviSource("C:\Movie 2.avi") and so on??
Yes it is.
You just have to generete a merged clip after all the "avisource" by using the "++" operator.
Code:
a=AviSource("C:\Movie 1.avi")
b=AviSource("C:\Movie 2.avi") 
c=AviSource("C:\Movie 3.avi")
a++b++c
All movie must have the same resolution (else you can use a=avisource().Bicubicresize()... to have a, b and c having the same reso before to reach the ++ line).

Quote:
Is it possible?
Yes it is but it's not exactly like this.

Quote:
and will the line be something like this:
a=trim(24,3452),(5678,12345)
b=trim(3333,888,(9999,9999) ??
a=AviSource("C:\Movie 1.avi")
b=AviSource("C:\Movie 2.avi")
trim(a,24,3524)++trim(a,5678,12345)++trim(b,3333,8 88)...

Read the manual, you will see that all commands have a first optional parameter called "clip" where you can give the name of the clip that will be affected by the command. By default it's the last one produced.

EDIT: inc, no need to use "return" if not in a function. and it's better to use ++ than + if the clip has sound (see AlignedSplice and UnalignSplice in the doc)
Reply With Quote
  #5  
01-06-2005, 10:58 AM
the viking the viking is offline
Free Member
 
Join Date: Sep 2004
Location: Norway
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Damned! Thats what we call fast replies!

Thanks a lot for the info.Im already making a script.
And its possible to have clips from a to z I guess?
Yes,all my clips have the same resolution.

---------------
viking
Reply With Quote
  #6  
01-06-2005, 12:08 PM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by the viking
Thanks a lot for the info.Im already making a script.
And its possible to have clips from a to z I guess?
You can call them "MyMovie" "MyOtherMovie" "MyThirdMovie"... and so on.

Note : if they you have a lot of them, perhaps it's faster to name them correctly and to use SegmentedAVISource
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Decomb 2.5.1 and hybrid clips J-Wo Avisynth Scripting 17 07-31-2004 01:47 AM
Opening an MPEG-1 file with AviSynth? PyRoMaNiA Avisynth Scripting 6 05-08-2004 10:37 AM
Converting multiple MPEG-1 files to KDVD? acanthusarch Video Encoding and Conversion 4 02-04-2004 12:26 PM
DVD2AVI: Request for MPEG-2 sample clips, qualty not a factor vhelp Video Encoding and Conversion 0 04-08-2003 11:48 PM
How do I open an MPEG file with avisynth for kvcd? telemike Avisynth Scripting 2 02-09-2003 04:51 PM

Thread Tools



 
All times are GMT -5. The time now is 08:01 PM  —  vBulletin Jelsoft Enterprises Ltd