I have three videos, only two have the same image dimensions. I can playback these two videos synchronized using AviSynth:
Now, the third video actually has the audio I want to play, and has a different format and dimension from the first two. I can play one of the first two videos with the third video's audio like this:Code:clip1 = DirectShowSource("leftVideo.avi", audio=false) clip2 = DirectShowSource("rightVideo.avi", audio=false) StackHorizontal(clip1,clip2)
My question is: How can I play all three videos at once, with the first two videos (leftVideo, rightVideo) stacked horizontally above, and have the third video show both video and audio centered below the horizontal stack?Code:Video=AVISource("leftVideo.avi") Audio=AVISource("thirdVideo.avi") AudioDub(Video,Audio)
Bonus: Is there a way to show the third video (audio and video) stacked constantly on the left, and manipulate the right video to toggle between the other two videos (via hotkey)?
Thanks in advance!
+ Reply to Thread
Results 1 to 18 of 18
-
-
clip1 = DirectShowSource("leftVideo.avi", audio=false)
clip2 = DirectShowSource("rightVideo.avi", audio=false)
clip3 = AVISource("thirdVideo.avi").AddBorders(whatever is necessary to make the width the same size as the the first two videos stacked horizontally)
AudioDub(StackVertical(StackHorizontal(clip1,clip2 ), clip3), clip3)
clip1 = DirectShowSource("leftVideo.avi", audio=false)
clip2 = DirectShowSource("rightVideo.avi", audio=false)
clip3 = AVISource("thirdVideo.avi").AddBorders(320,0,320,0 )
AudioDub(StackVertical(StackHorizontal(clip1,clip2 ), clip3), clip3)Last edited by jagabo; 6th Nov 2010 at 06:25.
-
What do you suggest if the top two videos (no audio) are both 644 x 484 and the bottom video (with the audio) is 720 x 576 ?
I'm trying this (below) but it doesn't work...
Code:clip1 = AVISource("leftVideo.avi", audio=false) clip2 = AVISource("rightVideo.avi", audio=false) Audio = AVISource("audioVideo.avi").AddBorders(284, 0, 284, 0) StackVertical(StackHorizontal(clip1,clip2), Audio)
-
Note I adjusted my earlier post a bit. You script looks like it should work. I suspect DirectShowSource() is returning video with a different colorspace than AviSource(). Try using AviSource() for all three. If they are still in different colorspaces you'll have to force them to match. For example:
clip1 = AviSource("leftVideo.avi", audio=false).ConvertToYV12()
clip2 = AviSource("rightVideo.avi", audio=false).ConvertToYV12()
clip3 = AVISource("thirdVideo.avi").AddBorders(284,0,284,0 ).ConvertToYV12()
AudioDub(StackVertical(StackHorizontal(clip1,clip2 ), clip3), clip3)Last edited by jagabo; 6th Nov 2010 at 06:36.
-
Looks great, thanks! But, the video is much slower than it should be, although the audio is fine. Is there any way to fix that?
I'm noticing that the top two are XVID and the bottom one is DVSD....
Thanks for your help!Last edited by oroboros74; 6th Nov 2010 at 06:49.
-
-
The problem seems to be the framerate, which I altered. Just to give you some practical context, the two videos are from high-speed cameras w/o audio (50fps) and the third is a DV camera (PAL, 25fps). This is how I forced it:
Code:clip1 = DirectShowSource("leftVid.avi", audio=false, fps=25, ConvertFPS=True).ConvertToYUY2() clip2 = DirectShowSource("rightVid.avi", audio=false, fps=25, ConvertFPS=True).ConvertToYUY2() clip3 = DirectShowSource("audioVid.avi", fps=25, ConvertFPS=True).AddBorders(284, 0, 284, 0).ConvertToYUY2() AudioDub(StackVertical(StackHorizontal(clip1,clip2), clip3), clip3)
Any other suggestions? -
what are your system specs ? maybe it's not fast enough to play 3 videos simulataneously ? open task manager and see if you are 100% loaded when playing
-
By "video starts lagging" you mean the video is playing more slowly than the audio? Are you just running out of horsepower? Two 50 fps clips and one 25 fps is a heavy workload for realtime playback.
Try ChangeFPS() instead of ConvertFPS=True. It should be faster. AviSource() is more reliable than DirectShowSource(). With DV AVI that's usually not a problem but I don't know about the other clips. -
Actually my CPU is only at 45-55%.
Here's a screenshot of the videos' specs. Consider that the two high-speed cameras produce videos like on the left, and the DV camera's video is on the right.
Size-wise, the high-speed camera videos are less than 10% each of the size of the DV, which never really exceeds a couple GBs (these are all very short clips).
Thanks again for your help on this! -
Actually, using AviSource makes the problem worse than DirectShowSource() (?)
I'm using GOM Player, but I tried just now with MPC and still nuthin'...
If you see the original post, I don't have problems when I use two of the videos together (sync fine), the problem I have a feeling is because of the different format of the third video... -
The problem could be with disk seeks -- three videos playing at the same time from three different places on the drive. As an experiment try playing the same file as clip1 and clip2. That way you're only reading two different videos. See if it's any smoother. Or put clip3 on a different drive than clip1 and clip2.
-
I still think it's likely to be a 'horsepower' problem - after all, you are trying to put together and play in real time a video of 1288x1060. Does it work if you leave out one of the upper videos? Eg
Code:clip1 = DirectShowSource("leftVid.avi", audio=false, fps=25, ConvertFPS=True).AddBorders(38, 0, 38, 0).ConvertToYUY2() # or clip2 clip3 = DirectShowSource("audioVid.avi", fps=25, ConvertFPS=True).ConvertToYUY2() AudioDub(StackVertical(clip1, clip3), clip3)
-
OK! I think we're getting somewhere!
Gavino's script works flawlessly (kudos!), but with two vids.
jagobo, three vids work great when clip1 and clip2 are both the same video file; I tried placing one of the videos on a external hard drive and have it play from there, and it was still choppy.
There are no problems in rendering three video files at once (as long as two are the same), and the CPU is only at 50% so help me understand: is it a problem with the HD having to seek three different files at once, or is it have to do more with the video card, or what?
And at this point, is it safe to say that there's no way to run more than two videos contemporaneously? Or what would I need? (but see here: https://forum.videohelp.com/threads/258275-Two-Video-Clips-Side-by-Side) -
Even though you're not seeing high CPU usage you may still be running out of CPU power. With video playback, when the CPU gets behind the player will attempt to seek forward in the file to skip past some frames (some players, depending on their settings, will just slow down the playback instead). This seeking takes time but doesn't show up as CPU usage in Task Manager. Add to that the fact that you're playing 3 files, two of which are at 50 fps, means you're putting a lot of stress on the CPU and disk drive(s). So you probably have a mixture of borderline CPU and disk performance. What CPU are you using? A dual core? Quad core?
If you don't need realtime playback you can just open the AVS script in an editor and create a new video file. That way each frame is read from the source files and is passed to the output, no matter how long it takes. Then you can play the new video file alone. -
Thanks a lot for your help and that explanation. I will have to try with our other PC (my laptop is just a dual core), and maybe it works there. Otherwise it may just as well be useful to create a single video file.
We have dozens of 3-minute clips which we need to analyze, but you guys certainly were of great help! Now I just need to figure out a way to automatize the process of creating all these scripts for all these clips (and if you guys have any last minute suggestions, they're very much appreciated!).
Thanks again for your help! It's been a learning experience!
Similar Threads
-
Avisynth - Stack 4 Videos But Too Slow - Help!
By controlalt in forum EditingReplies: 10Last Post: 14th Mar 2011, 08:36 -
PS3 video playback with multiple audio tracks?
By Browncoat in forum DVD & Blu-ray PlayersReplies: 5Last Post: 30th Dec 2008, 03:50 -
Sony Vegas 8 Pro Question - How to crop entire movie with multiple videos?
By Mysteriouskk in forum Newbie / General discussionsReplies: 4Last Post: 5th Mar 2008, 19:50 -
Single video with multiple simultaneous audio playback
By vhdmi in forum EditingReplies: 0Last Post: 27th Dec 2007, 15:50 -
Need to append one video to multiple videos
By woodface in forum EditingReplies: 4Last Post: 1st Oct 2007, 14:44