How do I Play Multiple Videos Simultaneously with a Set Position?
I'm looking for a way to play multiple different videos simultaneously with each video having its own coordinated position when it pops up on the screen. (Also possibly have them automatically pop up on screen as the front window)
https://www.geeksforgeeks.org/opening...
I started off here but I'm not sure where to go from here. Also not sure if it's just my computer or the imshow function having trouble playing 2 different videos at the same time
Here's code I got so far:
% capturing from the first camera attached
cap1 = cv2.VideoCapture('Blue_Bananas.avi') cap2 = cv2.VideoCapture('Green_Oranges.avi')
% will continue to play until 27 sec have passed
while True:
ret1, frame1 = cap1.read()
%Show Video
cv2.imshow('frame1', frame1)
% Program will terminate at 27 sec
k = cv2.waitKey(30) & 0xff if k == 27: break
while True:
ret2, frame2 = cap2.read()
cv2.imshow('frame2', frame2)
if k == 27:
break
% Releasing all the resources
cap.release()
cv2.destroyAllWindows()
please do not try to abuse opencv (a computer vision library) to build a video player.
bs. it won't. please read docs,since you obviously didn't
Program will terminate at 27 sec why ? I hope that the reason is not if k == 27: break
-Berak Thanks for being helpful. Now if you could provide a link in the documentation that actually would be helpful. This is for a class and I didn't come in knowing I'd be using opencv. I'm not trying to build a video player, I'm working on a project and thought opencv was the best choice for analyzing the videos. Don't I need to open the videos with opencv to run opencv functions? Or are you so clever you know a way around that that I don't?