Reputation: 3
How do I play the video.mp4 in fullscreen instead of playing it in a window and is there any way to play video with audio without playing the audio separately?
import cv2
from playsound import playsound
from threading import Thread
def func1():
cap = cv2.VideoCapture("video.mp4")
ret, frame = cap.read()
while(1):
ret, frame = cap.read()
cv2.imshow('frame',frame)
if cv2.waitKey(33) & 0xFF == ord('q') or ret==False :
cap.release()
cv2.destroyAllWindows()
break
cv2.imshow('frame',frame)
def func2():
playsound('6989946141014084358.mp3')
if __name__ == '__main__':
Thread(target = func1).start()
Thread(target = func2).start()
Upvotes: 0
Views: 594
Reputation: 51867
You should be able to setup the window ahead of time (e.g. before your blocking while loop):
cv2.namedWindow('frame',cv2.WINDOW_NORMAL)
cv2.setWindowProperty('frame',cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
Upvotes: 1