OpenCV frame capture with no output and errors (gstreamer)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

OpenCV frame capture with no output and errors (gstreamer)

1,935 次查看
9ghtX
Contributor I

I'm trying to get frames via Python OpenCV from my MIPI camera with gstreamer pipeline, but there is no any output messages like warnings, errors or cv2.imshow() frames.

Here is code that I'm trying to execute (found it in Internet):

import cv2

def receive():
    cap_receive = cv2.VideoCapture('udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! appsink', cv2.CAP_GSTREAMER)

    if not cap_receive.isOpened():
        print('VideoCapture not opened')
        exit(0)

    while True:
        ret,frame = cap_receive.read()

        if not ret:
            print('empty frame')
            break

        cv2.imshow('receive', frame)
        if cv2.waitKey(1)&0xFF == ord('q'
            break

    #cap_receive.release()

if __name__ == '__main__':
    receive()
    
    cv2.destroyAllWindows()
标签 (1)
0 项奖励
回复
1 回复

1,925 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello 9ghtX,

Is the code compile? you are trying to do a videocapture form UDP, is porbably that opencv detec that is not activate.

Regards

 

0 项奖励
回复