View Full Version : Show two half clips


Lele-brz
18th January 2008, 11:10
Hi,

I'd like to play two clips at the same time showing half of the first and half of the second at the same time.

I know about StackVertical, but in my case I want to overlap showing the two halves.

Hope I was not to confusing.

thanks

Lele-brz
18th January 2008, 11:42
I found it, for those interested

clip1 = DirectShowSource("red_low.mp4", fps=25)
clip2 = DirectShowSource("red_high.mp4", fps=25)
Overlay(clip1, clip2.Crop(320, 0, 0, 0), 320)

talen9
18th January 2008, 12:44
It should have worked with StackHorizontal too :

clip1 = DirectShowSource("red_low.mp4", fps=25).crop(0,0,clip.width/2,0)
clip2 = DirectShowSource("red_high.mp4", fps=25).crop(clip.width/2,0,0,0)
StackHorizontal(clip1,clip2)

I don't know which of the two way is the more efficient, though .... :confused:

IanB
19th January 2008, 07:37
The crop and stack.

Crops are zero cost, stacks cost a blit.

Overlay does an overlay operation, plus a conversion to it's internal YV24 format and back again. However it is more general purpose.

Lele-brz
19th January 2008, 09:51
Thanks for the tw answers.

And would it be possible to split the images considering the diagonal ?
And maybe draw a line to show where the two videos overlap?

IanB
19th January 2008, 23:20
For diagonal (or any non-rectangular arbitrary shape) you can use Overlay with a Mask Clip to describe which parts of the image to action. Being a clip the mask may vary from frame to frame if you desire.

To draw a line you would have to add the line as an extra Overlay step.