我试图通过管道使用opencv和gstreamer在python中发送视频。 vp8编解码器会发生这种情况。
在接收器上,我看到以很小的增量而不是彩色复制的帧(参见图像)。我的gstreamer管道有什么问题?它可以通过h264或jpeg管道运行,但我需要vp8正常工作。
我用过
谢谢。
Problem: at the receiver the frame is shown several times.
import numpy as np
import cv2
vp8 = "appsrc ! videoconvert ! videoscale ! video/x-raw,width=640,height=360 ! vp8enc ! rtpvp8pay ! udpsink host=127.0.0.1 port=5000"
out = cv2.VideoWriter(vp8, 0, 25, (640,360))
while(True):
ret, frame = cap.read()
out.write(frame)
cap.release()
cv2.destroyAllWindows()
import numpy as np
import cv2
vp8 = "udpsrc port=5000 ! application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)VP8-DRAFT-IETF-01, payload=(int)96 ! rtpvp8depay ! vp8dec ! appsink"
cap = cv2.VideoCapture(vp8, cv2.CAP_GSTREAMER)
while(True):
ret, frame = cap.read()
if ret:
cv2.imshow('receiver',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()