View Full Version : Filter to merge 4 320x240 videos into 1 640x480 video?
Stabmaster-Arson
6th December 2002, 23:56
Like 4 squares, 4 video sources, side to side then at the bottom? does this exist? OR does anyone know of a way to do this?
hakko504
7th December 2002, 00:26
v1=AviSource(video1.avi)
v2=AviSource(video2.avi)
v3=AviSource(video3.avi)
v4=AviSource(video4.avi)
v5=stackhorizontal(v1,v2)
v6=stackhorizontal(v3,v4)
return stackvertical(v5,v6)
Stabmaster-Arson
7th December 2002, 02:18
Thank you so much! I had no idea where to start, and did nmot know what keywords to use with the search feature!
you rule.
Stabmaster-Arson
11th December 2002, 06:09
OK, I tried what you said, it did not work, but you got me pointed in the right direction. I managed to fudge through it all, and I got it working. Here is the script to do it. (When I tried your method vdub and wmp would just disappear without an error!
This works, I have tested it. (Make sure it has no audio)
________________________________________
v1=avisource("f:\1.avi")
v2=avisource("f:\1.avi")
v3=avisource("f:\1.avi")
v4=avisource("f:\1.avi")
v5=stackhorizontal(v1,v2)
v6=stackhorizontal(v3,v4)
v7=stackvertical(v5,v6)
return(v7)
________________________________________
stickboy
11th December 2002, 12:29
It's the same thing. hakko504 just forgot to put double quotes around the filenames.
Stabmaster-Arson
12th December 2002, 23:51
I put quotes around my filenames when I did it his method. The syntax just did not work.
DVD__GR
13th December 2002, 01:52
Just wondering if we can join different sources videos,resize them and then encode in lets say svcd changing a little the above script?
Stabmaster-Arson
19th December 2002, 00:22
Just wondering if we can join different sources videos,resize them and then encode in lets say svcd changing a little the above script?[quote
As far as resizing, I did not try as my sources were the same. I see no reason why it would not work, but I am pretty new to avisynth and not sure of the exact syntax here.
What you want to do is have the variable, say,
v2=avisource("clip.avi")+bicubicresize (320,240)
Thats what i would want but don't know the proper syntax fo. It'd be great if someone could fix the syntax of my above line!
Since I did not know how to do it with avisynth, I did resize one of my clips and compressed using huffyuv, so everything was ready for input.
I used this to make a neat SVCD intro, with the 4 different scenes from the video all together.
3 of my sources were 23.976, onf was 25 fps, so i just changed the framerate of the 25 to 23.976 using vdub direct stream copy, then it was ready for joining. This change in framerate did not matter as I did not have to maintain av sync cause the final video is just music and sound effects that I added to it.
Richard Berg
19th December 2002, 00:38
v2=avisource("clip.avi").bicubicresize (320,240)
onesoul
19th December 2002, 02:04
Btw, is there a way to to merge 4 mpeg files? I tried it with directshowsource but I couldn't do it. When it reaches the stackvertical it says it can't talk to graph editor.
One directshowsource alone didn't give problems (without stack vertical offcourse)
Here's the code I used:
t4=DirectShowSource("c:\test\4.mpg")
t3=DirectShowSource("c:\test\3.mpg")
t2=DirectShowSource("c:\test\2.mpg")
t1=DirectShowSource("c:\test\1.mpg")
h1=StackHorizontal(t1, t2)
h2=StackHorizontal(t3, t4)
stackvertical(h1, h2)
Richard Berg
19th December 2002, 05:31
To clarify -- 'return h1' and 'return h2' both execute correctly?
onesoul
19th December 2002, 21:20
Originally posted by Richard Berg
To clarify -- 'return h1' and 'return h2' both execute correctly?
No it doesn't. All mpeg files have sound (these are exactly same clips, I was doing this to compare the output with different filters), should I disable sound? How do you do it?
hakko504
19th December 2002, 22:36
If they are the same clip, they should not be re-opened. But I assume you already have done the filtering? If not, does something like this work?a=DirectShowSource("c:\test\1.mpg").Killaudio() #Needs a new version of AviSynth, 2.05+ I think.
b=a.Convolution3d(preset="movieLQ")
c=a.Convolution3d(preset="movieHQ")
d=a.Convolution3d(preset="animeLQ")
e=a.Convolution3d(preset="animeHQ")
h1=StackHorizontal(a, b)
h2=StackHorizontal(c, d)
stackvertical(h1, h2)
Stabmaster-Arson
19th December 2002, 23:27
You must not have sound in the videos, as far as I can tell. For mpg files use tmpgenc demux to get straight video. For avi use virtualdub, direct stream copy the video and choose No audio.
@ Richard, thx muchly for that code snipet, you made my work easier there.
onesoul
20th December 2002, 07:09
Thank you for your replyes.
The clips were already encoded with different filters, I forgot to mention it, I now realize that directshowsource only seems to work with only one input (not more than one directshowsource).
I tried before to do an encoding like hakko504 mentioned but with different filters like nomosmooth, convolution3d and fluxsmooth but the stackhorizontal seemed to mess both clips, only crossing lines(really weird). I guess that you can't do stack with diferent filters running but I am not sure. I did this with mpeg2source.
edit: One little detail, I use link2 to wrap the avs scripts. I can't open directly with windows media player, have no idea why.
Stabmaster-Arson
22nd December 2002, 02:41
Did you do it like this?
v1=directshowsource(file.avi).filter(blahblah).otherfilter(bla)
v2=directshowsource(file.avi).filter(blahblah).otherfilter(bla)
??
Stabmaster-Arson
24th December 2002, 08:14
OK through more testing i see what was wrong with Hakkos script, and I got it to work. The key is the extra set of () needed in this line
return(stackhorizontal(v3,v6))
It neds the extra brackets there as you can see.
Stabmaster-Arson
24th December 2002, 08:17
Just thinking, and seeing as how they are incompatible filterwise and everything, and those that are working with the new yv12 version's info being not too useful for those that are using the mainstream version. Also there is and is and is going to continue to be alot of new posts specifically related to the yv12 version as many are testing it and alot of filter development and bugchecking to do.
Just my 2 cents, I think it would be a good idea to split it in 2.
Wilbert
24th December 2002, 11:25
Just thinking, and seeing as how they are incompatible filterwise and everything
How are they incompatible, looking at stackhor/stackver ?
OK through more testing i see what was wrong with Hakkos script, and I got it to work. The key is the extra set of () needed in this line
return(stackhorizontal(v3,v6))
You don't need that:
return stackhorizontal(v3,v6)
or
stackhorizontal(v3,v6)
also works.
Just my 2 cents, I think it would be a good idea to split it in 2.
There's no need for that. AviSynth v2.5 is just a new version of AviSynth (with the only real difference that plugins are not compatible). I don't think we should start a new forum for every new version.
sh0dan
25th December 2002, 01:56
Well, thanks Wilbert ;) (note the irony)
But from the user point of view I see a point. Perhaps a split into "AviSynth Daily Usage" and "AviSynth Advanced / Development" forum would be of some help.
I do appreciate the daily user inputs very much - it helps a lot too see which features are easy to use, and what could be improved. But considering the amount of posts (by far the largest here on doom9) it could help "daily users" to split the forums.
I love to be able to have technical discussions here - having this close developer/user contact helps both sides very much, but sometimes it's hard to justify the "technicality"-level of the discussions. (and I'd hate to have it moved to the "development" forum.
Wilbert
25th December 2002, 16:43
Maybe you are right. I guess you have something like the dvd2svcd basic topics and advanced topics in mind. To be quite honest I don't find the advanced topics forum very pleasing to read. Looking at the titles you see that four out of every five posts are moved to the basic forum (it's a bit ennoying to see those titles). I guess that will be a lot of work for Neuron2 (I guess Dividee has a break, and Steady, well I have never seen him since I'm a member of this forum) :)
sh0dan
25th December 2002, 19:14
I see your point. You could argue, that is it easier to distinguish when talking about AviSynth than DVD2SVCD (development vs non-development) - even though user testing is _essential_ for this to work.
But the forum works well now, and neuron is doing a great job. Don't want to put any more burdens on his shoulders. Let's see if there is an up-rise from p*ssed *ff users, wanting us to stop talking tech-cr*p all the time :p
scmccarthy
25th December 2002, 22:21
I think some of the users enjoy weighing in. The way it is now, you can sometimes ask users and developers for input on the direction for AviSynth together. Several of the users program in languages other than C or C++ and understand development issues without being able to write an AviSynth filter.
Stephen
Guest
26th December 2002, 03:54
I remember the days when everybody used 0.3 and moving to 1.x was a big deal. 0.3 is forgotten now, just as 2.0x will be. We can't keep making forums to track program version numbers. :-)
As for breaking it into everyday versus technical/advanced, I don't see any symptom in need of fixing. I agree that the crosspollenation between the two camps is stimulating and beneficial for both. No need to change anything right now, IMHO.
Stabmaster-Arson
28th December 2002, 09:43
Actually, When I suggested a new forum for avisynth 2.5 I intended to make a brand new post about it; instead I accidentally went off topic here. That post had and has nothing to do with the stackvertical business.
ANyhoo, you already have my vote for new avisynth forum, bleeding edge style, as it seems to me to e more than just "The latest version" due to its complete incompatibility with all the old filters.
Cheers.
-Stab
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.