Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to build a mediaPlayer using Python (LIB: wxPython, Mplayer, MplayerCtrl, OpenCV). I am using openCV to give a no look Pause feature.
Real Time pace detection is running on a infinite loop and in Mplayerctrl Pause serves as Both Pause and Unpause button. and also the playback timer and playback slider is not working . If anyone could help.
Python
def on_special(self,event):
    cap = cv2.VideoCapture(0)
    flag=True
    while flag:
        ret, img = cap.read()
        #gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
        faces = face_cascade.detectMultiScale(img, 1.3, 5)
        #Draw Rectangle along Face
        for (x,y,w,h) in faces:
            cv2.rectangle(img,(x,y),((x+w),(y+h)),(255,0,0),2)
            faces1=faces
            #roi_gray = gray[y:y+h, x:x+w]
            roi_color = img[y:y+h, x:x+w]
            '''eyes = eye_cascade.detectMultiScale(roi_gray)
            #Draw rectangle along eyes
            for (ex,ey,ew,eh) in eyes:
                cv2.rectangle(roi_color,(ex,ey),(ex+ew,ey+eh),(0,255,0),2)'''
        cv2.imshow('img',img)
        self.mplayer.Pause()
        k = cv2.waitKey(30) & 0xff
        if k == 27:
            break
    cap.release()


What I have tried:

i am having problem with the pause function.. As an infinite loop is running and the Pause() handles the function 2 ways (Pause and Unpause)...
So if anyone could see :)
Posted
Updated 1-Jan-18 11:22am
v2
Comments
Richard MacCutchan 1-Jan-18 9:11am    
Please do not just dump all your code (especially not twice) and expect someone to debug it for you. Edit your question, remove the code that is not part of the problem, and explain exactly what the problem is.
Toufique-Sk 1-Jan-18 17:15pm    
ok thank you Sir :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900