Quantcast Avisynth: Joining Files Using Avisynth? - digitalFAQ.com Forums [Archives]
  #1  
08-14-2002, 08:57 AM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
Hi All,

To Join 4 SVCD files to create one KVCD Plus 704x480 output file,
I used the following script. My problem is trying to use TRIM to
control the frames selected for each video. It doesn't seem to
work. I get no errors from avisynth, but when previewed in tmpgenc
the command is ignored. If you have any suggestions let me know.

LoadPlugin("E:\DVD Backup\2 - DVD2SVCD\MPEG2Dec\MPEG2DEC2.dll")
#
video=mpeg2source("D:\Temp\avseq01.d2v")
audio=AVISource("D:\Temp\avseq01.wav")
clip1=AudioDub(video,audio)
#trim(clip1,0,5000)
#
video2=mpeg2source("D:\Temp\avseq02.d2v")
audio2=AVISource("D:\Temp\avseq02.wav")
clip2=AudioDub(video2,audio2)
trim(clip2,30,0)
#
video3=mpeg2source("D:\Temp\avseq03.d2v")
audio3=AVISource("D:\Temp\avseq03.wav")
clip3=AudioDub(video3,audio3)
#trim(clip3,0,5000)
#
unalignedsplice(clip1,clip2,clip3)
#
BicubicResize(704,480,0,0.6,0,0,480,480)
#TemporalSmoother(2,1)
AddBorders(0,0,0,0)


Thanx
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  
08-14-2002, 01:51 PM
rendalunit rendalunit is offline
Free Member
 
Join Date: Apr 2002
Location: san jose, Ca
Posts: 1,148
Thanks: 0
Thanked 0 Times in 0 Posts
hey black prince,

I don't know if you already know this or not- but the '#' before a command will make avisynth skip the command because it's a remark. In your script you have a # before 3 of the Trim commands- you need to remove those.

ren
Reply With Quote
  #3  
08-14-2002, 05:17 PM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
hey ren,
look at the statement "trim(clip2,30,0)"
It's uncommented. When I made this svcd movie over
a year ago, I started the second svcd with 30 seconds
of the end of the first svcd. With "TRIM", I wanted
to remove this so the movie appears to have no gaps.
By the way, the re-encodes of svcd to kvcd Plus are not
only coming out with excellent quality, but the size is even
smaller than DVD to KVCD. I am re-encoding "The
Green Mile" which is a 3+ hrs using 704x480 and the
size was 1.5GB without credits. I just finished viewing 1 hr 18 min
and it's very very nice. I wonder if you and/or Kwag
could comment on why the file size became even smaller.
The re-encoded svcd's created with DVD2SVCD seem to create
the best quality KVCD Plus movies.
Reply With Quote
  #4  
08-14-2002, 05:47 PM
rendalunit rendalunit is offline
Free Member
 
Join Date: Apr 2002
Location: san jose, Ca
Posts: 1,148
Thanks: 0
Thanked 0 Times in 0 Posts
3+ hrs -> 704x480 Plus -> 1.5 gb WITH SOUND! How did you do that!!?? I got a couple 3 hr movies onto 2 cds with the 352x480 Plus template but not the 704x480. I would say that it's smaller because it's a second generation encoding and there's quality loss- but if you say it looks good I won't argue with that Actually my re-encoded svcds look pretty good too- I didn't use any noise filters but I did have to deinterlace.

I don't know anything about the Trim command with avisynth because I never used that before- does it remove a number of frames from the start or end of a movie?
Reply With Quote
  #5  
08-15-2002, 10:16 AM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
hey ren,

Yes, it's true. I used KVCD Plus 704x480 with default settings. Also,
used TemporalSmoother(2,1) and cut out movie credits. I too was
supprised at the size, so I watched the whole movie (3 hrs., 8 min.).
It was as good as the original SVCD, except it now fits on two CD's.
Dvd2avi stats preview the movie as 4:3, 29.976 fps, so I set
force film on to change it to 23.976 fps. Joined all the .dv2 using avisynth
and created batch encoding job to turn off my computer when done.
15 hours later I created the audio using tmpgenc (170MB) via
avisynth. Multiplexed using bbMPEG and the rest is history.
The original svcd used 4 650MB CD's and filled them completely.
I am going to try "Pear Harbor" next to make sure this was not a fluke.
Trim is suppose to control starting frame and ending frames of the video.
trim(clip,start frame,end frame) is the syntax. I think the clip parm
is where I may be refrencing incorrectly. When you create an avs file
using FitCD it's there commented out. But the refrence to a multiple video
can also be used, if I can get it to work. My layman's theory is like yours.
That with fewer bits to scan (SVCD) and the file produced should be
smaller. Some SVCD's are very close to KVCD Plus 704x480.
I personally like KVCD Plus 704x480 and will try to make a movie
fit this encode. 352x480 is good, but 704x480 is the best.
Reply With Quote
  #6  
08-15-2002, 02:20 PM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
Hey Ren,

Finally got this puppy to work nice. Selecting audio and video frames
while keeping everything in sync finally works. Any suggestions
as usual are welcome. So here we go:

LoadPlugin("E:\DVD Backup\2 - DVD2SVCD\MPEG2Dec\MPEG2DEC2.dll")
#
video=mpeg2source("D:\Temp\avseq01.d2v")
audio=WAVSource("D:\Temp\avseq01.wav")
v1=trim(video,500,0) # <--- start from frame 500 to end (video)
a1=trim(AudioDub(video,audio),500,0) # <--- start from frame 500 to end (audio)
clip1=AudioDub(v1,a1) # <--- Join selected video/audio clip
#
video2=mpeg2source("D:\Temp\avseq02.d2v")
audio2=WAVSource("D:\Temp\avseq02.wav")
clip2=AudioDub(video2,audio2)
#
video3=mpeg2source("D:\Temp\avseq03.d2v")
audio3=WAVSource("D:\Temp\avseq03.wav")
clip3=AudioDub(video3,audio3)
#
video4=mpeg2source("D:\Temp\avseq04.d2v")
audio4=WAVSource("D:\Temp\avseq04.wav")
clip4=AudioDub(video4,audio4)
#
unalignedsplice(clip1,clip2,clip3,clip4) # <--- merge all A/V clips
#
BicubicResize(672,448,1/3,1/3,0,0,480,480)
#TemporalSmoother(2,1)
AddBorders(16,16,16,16) # <--- TV overscan from FitCD
#
I use tmpgenc to guide me on which frames to include.
Reply With Quote
  #7  
08-15-2002, 09:43 PM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Hi black prince,
Can you explain the first part of your scrip?
I got a little bit confused...

Quote:
Originally Posted by black prince
video=mpeg2source("D:\Temp\avseq01.d2v")
audio=WAVSource("D:\Temp\avseq01.wav")
v1=trim(video,500,0) # <--- start from frame 500 to end (video)
a1=trim(AudioDub(video,audio),500,0) # <--- start from frame 500 to end (audio)
clip1=AudioDub(v1,a1) # <--- Join selected video/audio clip
Please, correct me if I'm wrong, but the 3 last lines shouldn't be just this one?...
clip1=trim(AudioDub(video,audio),500,0)
I believe that this line will join the video+audio and trim then both to start from frame 500 to end. Is it what you want?

Regards,
Reply With Quote
  #8  
08-16-2002, 10:51 AM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
Muaddib,

a1=trim(AudioDub(video,audio),500,0) is compound. There is no
direct way to trim the audio file except when the video is present.
Avisynth doesn't seem to have a command to trim both at the same
time. Therefore separate trims, v1 and a1. Try it and see what you
think.
Reply With Quote
  #9  
08-16-2002, 06:54 PM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by black prince
Muaddib,

a1=trim(AudioDub(video,audio),500,0) is compound. There is no
direct way to trim the audio file except when the video is present.
Avisynth doesn't seem to have a command to trim both at the same
time. Therefore separate trims, v1 and a1. Try it and see what you
think.
I think that the trim filter do trim both (video+audio) at the same time...
Here is what I found in the avs docs:
"Trim trims a video clip so that it includes only the frames first-frame through last-frame. The audio is similarly trimmed so that it stays synchronized."
Reply With Quote
  #10  
08-17-2002, 12:26 PM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks Mauddib,

I did try trim(video,start frame,end frame). the result
was the video was trimmed, but the audio was not.
Go figure. The script I submitted is from VCDHelp's
advanced avisynth guide. There you will find an example
of this script and others. It works for both audio and video.
Try a test case and if it works let me know.
Reply With Quote
  #11  
08-17-2002, 11:03 PM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Hi black prince,

Here is the test I did:
I was using this script to encode a music clip.
I just add the wavsource at the beginning and the last trim command at the end.

LoadPlugin("D:\DVD Rip Tools\mpeg2dec\mpeg2dec.dll")
vid1=Mpeg2Source("C:\Temp\cassia_eller\malandragem .d2v")
aud1=WavSource("C:\Temp\cassia_eller\malandragem.w av")

vid2=Subtitle(vid1,"Malandragem",465,390,70,280,"a rial",33,$FFFFFF,$000000)
vid3=Subtitle(vid2,"(Cazuza/Frejat)",470,414,70,280,"staccato222 bt",26,$FFFFFF,$000000)

vid4=vid3.BilinearResize(480,480,0,0,720,480)

vid5=Dissolve(Blackness(vid4,60),vid4,60)
vid6=Dissolve(Trim(vid5,0,7202),Blackness(vid4,210 ),150)

Trim(AudioDub(vid6,aud1),200,600)


It works perfectly! The last trim results in the first 600 frames of video + audio, discarding the first 200 frames. The audio and video were in sync.
Reply With Quote
  #12  
08-18-2002, 12:53 PM
black prince black prince is offline
Free Member
 
Join Date: Jul 2002
Posts: 1,224
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Muaddib,

I did a cut and paste of your script. Tested it and it worked.
Thanks. I wanted a script to join wav file created by Mpeg
Mediator from CD SVCD mpg files. I used VirtualDub to merge
them into one wave via avs and Headac3he to create the final mp2.
I tried to get Mpeg Mediator to read them all at once but, it
kept quiting after the first avseq01.mpg. That's why I used
the avs script to join these files. Not sure what my script was
doing but thanks for the correction.
Reply With Quote
  #13  
08-19-2002, 03:20 AM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Sure thing, black prince!

If it's working for you... great!
I just point it cause I thought: "Why use 3 lines when you can do it with 1?"

Bah... just ignore that! It's an old habit.
(or should I say an optimization paranoia of an old programmer )
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
VirtualDub: Problem joining two avi files cyron Video Encoding and Conversion 6 09-09-2004 04:10 AM
HeadAC3he: Joining two mp2 files together khusru Audio Conversion 4 06-12-2004 06:53 PM
joining 650mb files into .mpg format? Big2hd Video Encoding and Conversion 4 12-20-2003 04:39 AM
TMPGEnc: A new way of joining mpeg1 files rendalunit Video Encoding and Conversion 3 07-26-2002 05:04 PM
TMPGEnc: Joining files aderunn3r Video Encoding and Conversion 2 06-15-2002 11:27 AM

Thread Tools



 
All times are GMT -5. The time now is 02:49 PM  —  vBulletin © Jelsoft Enterprises Ltd