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

asked 2014-07-16 03:51:24 -0600

wzj gravatar image

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

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by berak
close date 2014-07-17 02:10:44.295006

Comments

do you really need rtp ? or would a simple mjpeg do as well ?

berak gravatar imageberak ( 2014-07-16 04:02:32 -0600 )edit

i just wanna real-time transport the video stream ... and the rtp is what i think of the first protocol

wzj gravatar imagewzj ( 2014-07-16 04:33:42 -0600 )edit

maybe something as simple as this might get you started. (single thread,single client)

berak gravatar imageberak ( 2014-07-16 04:36:02 -0600 )edit

that's a task from my tutor... and i want to do that step by step. The final goal is that bulid a webcam... Do you have any advice to me ... THX

wzj gravatar imagewzj ( 2014-07-16 04:41:05 -0600 )edit

ahh, ok. no real idea then. writing a nice, fluid server is a hard task.

berak gravatar imageberak ( 2014-07-16 04:44:43 -0600 )edit

thx anyway

wzj gravatar imagewzj ( 2014-07-16 04:46:31 -0600 )edit

Hi sir! did you solve the problem, I also have the same problem to send the mat/images to rtmp server. Thanks!

BAHRAMUDIN ADIL gravatar imageBAHRAMUDIN ADIL ( 2017-11-02 01:20:38 -0600 )edit