Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to process the 'frame' (opencv) into a video streaming and real-time transmission to other servers

I am a beginner in opencv(python) and spent a lot of time . I want to record video and real-time transport to the other server. here is the code. import cv2

cap = cv2.VideoCapture(0)

out = cv2.VideoWriter('output.avi', cv2.cv.CV_FOURCC('M', 'J', 'P', 'G'), 20.0, (640,480))

while(cap.isOpened()): ret, frame = cap.read() if ret == True:

    out.write(frame)

    cv2.imshow('show', frame)
    if cv2.waitKey(1) & 0XFF == ord('q'):
        break

cap.release() out.release() cv2.destroyAllWindows()

i don't know what type of data is 'frame' and how to process it to be a stream to transport to the another server in real-time. hope someone help me to solve this problem