View Full Version : Joining different formats
Vladimirovich
12th May 2002, 13:29
I want to insert logo in the begining of AVI file. I've created AVI file (1 frame, uncompressed), and named it "logo.avi". The second file is avs stream, that was generated by GuardianKnot. But all my effords to make avs file, that could join those streams faild. VirtualDub reports some error (incompatible format or so). So, is it possible to do something?
Acaila
12th May 2002, 15:39
VDub can only join two files if:
1) They have the same resolution
2) They have been compressed by the same codec
3) They have the same colordepth
Using Avisynth you can do the following:
Source1=AVISource("Logo.avi")
Source2=MPEG2Source("Movie.d2v") #or whatever the main avi comes from
Return Source1+Source2
And just open this avs file in VDub to compress as one file.
Vladimirovich
12th May 2002, 16:29
And what if the second file is not the same resolution?
For example, if I want target resolution to be 640x320, the "Logo.avi" is already in this resolution, but "Movie.d2v" is not. So, i have tried something like this:
first, main.avs
AVISource("Logo.avi")+AVISource("movie.avs")
second, movie.avs
MPEG2Source("Movie.d2v")
BicubicResize(...) #Here we resize to 640x320 size
When I open movie.avs, I've got nice 640x320 file.
When I open logo.avi, I've got 640x320 file, too.
But when I open main.avs I've got an error.
Where I'm wrong?
Acaila
12th May 2002, 17:45
Like I said, two files of different resolution can't be appended to eachother. If you resize one to match the other, they can be appended, as you see with your movie.avs.
So just do it like this:
Source1=AVISource("Logo.avi")
Source2=MPEG2source("Movie.d2v").BicubicResize(640,320)
Return Source1+Source2
You can put any other filters you want to use on the Movie.d2v in a chain using dots just like I did with BicubicResize above. Feed that into VDub and you can compress them any way you want.
Vladimirovich
13th May 2002, 10:04
Of course not! But they are the same size!
I've tried something like this:
a=AVISource("Logo.avi").BicubicResize(640,320,0,0.5)
b=AVISource("Movie.avs").BicubicResize(640,320,0,0.5)
return a+b
Note the fact, that Logo.avi is allready 640x320.
But this doesn't work. I've got error message:
Avisynth open failure:
Splice video formats don't match
(f:/movie.avs")
Maybe I use some buggy version? I've use one which comes with guardian knot.
What exactly does this error means?
hakko504
13th May 2002, 10:28
I can think of two more things:
[list=1]
Are they the same framerate?
Try ConverttoRGB or ConvertToYUY2 before joining the clips
[/list=1]
Vladimirovich
13th May 2002, 11:39
The framerate is, of course, the same, but the second - ConvertToYUY2 - is a good idea! What is the syntax of it?
Just "a.ConvertToYUY2()" ?
Acaila
13th May 2002, 12:28
a=AVISource("Logo.avi").BicubicResize(640,320,0,0.5)
b=AVISource("Movie.avs").BicubicResize(640,320,0,0.5)
return a+b
Avisynth open failure:
Splice video formats don't match
(f:/movie.avs")
You're getting that error, because you are calling your movie.avs with an AVISource() command. The .avs is NOT an AVI, but an MPEG2, and thus Avisynth can't decode it properly (look more carefully at what i wrote before).
Btw, there's no need to call an .avs file (is it even possible to call an .avs inside an .avs file?), just put this scipt IN the movie.avs file. Why over-complicate things?
Ps.
Why re-resize your already resized Logo.avi?
hakko504
13th May 2002, 13:07
@Vladimirovich
Yes, your script would look something like this:a=AVISource("Logo.avi").BicubicResize(640,320,0,0.5).ConvertToYUY2()
b=AVISource("Movie.avs").BicubicResize(640,320,0,0.5).ConvertToYUY2()
return a+b
@Acaila
AVISynth means AVI synthesizer, and is a script language that emualtes AVI video clips. and can most certainly be opened with AVISource (even though I can think of a lot of reasons why it shouldn't). Who told you that .avs are MPEG2 encoded? That is ridiculous. please read the documentation, both Ben Rudiak-Gould's original (http://www.math.berkeley.edu/~benrg/avisynth.html) and Videotools updated (http://www.videotools.net)
Acaila
13th May 2002, 14:27
@hakko504
I had already read both of them thank you very much. Maybe I was assuming too much, but since this is an MPEG ripping/converting forum I assumed he was either converting a DVD (=MPEG2) source (because he referred to GKnot) or a captured (=MPEG1 or 2) source, and you'll need MPEG2Source() to open them correctly.
However if his source was already converted into an AVi then you are correct and AVISource() would suffice.
hakko504
13th May 2002, 15:01
Originally posted by Acaila
The .avs is NOT an AVI, but an MPEG2, and thus Avisynth can't decode it properly (look more carefully at what i wrote before).
From Bens documentation of AVISource
AVISource takes as argument one or more file name in quotes, and reads in the file(s) using either the Video-for-Windows "AVIFile" interface, or Avisynth's built-in OpenDML code (taken from VirtualDub). This filter can read any file for which there's an AVIFile handler. This includes not only AVI files but also WAV files, AVS (Avisynth script) files, and VDR (VirtualDub frameserver) files. If you give multiples filenames as arguments, the clips will be spliced together with UnalignedSplice.
What is contained by the .avs and how the system percieves the avs is quite different. Since windows thinks the .avs is an .avi then it is possible to open it with AVIsource. The fact that the .avs he opens in itself refers to an MPEG1/2 source does not matter. It is therefor not necesary to convert the .avs to .avi before reopening it with AVIsource.
Also, unless you have a HW MPEG-2 encoder on the capture card very few people uses MPEG for capturing. Huffyuv or MJPEG are the favoured choises ATM.
Acaila
13th May 2002, 16:09
The fact that the .avs he opens in itself refers to an MPEG1/2 source does not matter. It is therefor not necesary to convert the .avs to .avi before reopening it with AVIsource.
Ok I did not know that. I thought it would still be considered MPEG2 (decoded by mpeg2dec.dll) because that is the original source the .avs file points to.
I stand corrected. :cool:
hakko504
13th May 2002, 18:19
:)
SaferSephiroth
19th July 2007, 01:35
@Acalia
"is it even possible to call an .avs inside an .avs file?"
Actually, it is. I do this quite often and have never had any problems calling on multiple .avs's within an .avs. Except, of course when my syntax gets sloppy. ;)
neuron2
19th July 2007, 04:20
Are you aware that you are responding to a 5-year-old post? :)
hakko504
19th July 2007, 08:31
Are you aware that you are responding to a 5-year-old post? :)
No wonder I didn't recognize the title when I got the reminder email today :cool: :devil:
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.