OpenCV frame capture with no output and errors (gstreamer)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

OpenCV frame capture with no output and errors (gstreamer)

1,931件の閲覧回数
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,921件の閲覧回数
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 件の賞賛
返信