Python 打开opencv | Gstreamer警告:无法查询视频位置:雕像=0,值=-1,持续时间=-1 我正在使用OpenCV软件包在NVIDIA jetson nano上实现视频录制功能。

Python 打开opencv | Gstreamer警告:无法查询视频位置:雕像=0,值=-1,持续时间=-1 我正在使用OpenCV软件包在NVIDIA jetson nano上实现视频录制功能。,python,nvidia-jetson-nano,Python,Nvidia Jetson Nano,当我使用代码时,我遇到了相同的GStreamer错误## import cv2 import numpy as np camera = cv2.VideoCapture(“nvarguscamerasrc ! video/x-raw(memory:NVMM),width=640,height=480,format=NV12,framerate=30/1 ! nvvidconv flip-method=0 ! videoconvert !video/x-raw,formate=BGR ! app

当我使用代码时,我遇到了相同的GStreamer错误##

import cv2
import numpy as np

camera = cv2.VideoCapture(“nvarguscamerasrc
! video/x-raw(memory:NVMM),width=640,height=480,format=NV12,framerate=30/1
! nvvidconv flip-method=0 ! videoconvert !video/x-raw,formate=BGR ! appsink”)

fourcc = cv2.VideoWriter_fourcc(*‘mp4v’)

videoOut = cv2.VideoWriter(‘camera.mp4’,fourcc,30.0,(640,480))

isRead,frame = camera.read()
while isRead :
videoOut.write(frame)

  cv2.imshow('xianshi',frame)

  if cv2.waitKey(30) == 27:
       break
  
  isRead,frame = camera.read()
camera.release()
videoOut.release()
cv2.destroyAllWindows()