Ask Your Question
0

play 2 videos simultaneously

asked 2020-05-18 05:09:55 -0600

seahyw gravatar image

I would like to play 2 videos in 1 window, which one is full size and another one is small video screen on the right top corner of the first video. Is it possible?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-05-18 08:26:29 -0600

berak gravatar image

updated 2020-05-18 08:27:35 -0600

you could copy the small img into the large one (aka: picture in picture), like:

Mat small, large;
cap1 >> small;
cap2 >> large;

// desired size
int w = 200;
int h = 200;
resize(small,small,Size(w,h));

// dst roi, top right:
Rect roi(large.cols-w-1, 0, w, h);

small.copyTo(large(roi));
imshow("PiP", large);
waitKey(10);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-05-18 05:09:55 -0600

Seen: 177 times

Last updated: May 18 '20