Hi, I have been trying to get gstreamer to work in python and I can get the conversion to work.
This:
gst-launch-1.0 v4l2src ! ‘video/x-raw, width=(int)1600, height=(int)1300, framerate=(fraction)120/1, format=(string)GRAY8’ ! videoconvert ! xvimagesink -ev
Open up the stream and shows video. Same in does not convert. I got it to display a 20fps by doing :
gst_str = ('v4l2src device=/dev/video0 ! video/x-raw , width=(int)1600 , ’
'height=(int)1300 , format=(string)GRAY8 , framerate=(fraction)60/1 ! videoconvert ! video/x-raw,
format=BGRx ! videoconvert ! appsink ')
This works with warning:
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (933) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
, but I think, for my tensorflow project I must have gstreamer working with NVMM and nvvidconv. I assume that I need to utilise the NVMM memory?.
So I try to write the gst like so:
gst_str = ('v4l2src device=/dev/video0 ! ’
'video/x-raw(memory:NVMM), ’
'width=(int)1600, height=(int)1300, ’
'format=(string)GRAY8, framerate=(fraction)30/1 ! ’
'nvvidconv ! ’
'video/x-raw(memory:NVMM), width=(int){}, height=(int){}, ’
'format=(string)BGRx ! ’
‘videoconvert ! appsink’).format(width, height)
I get new errors and cant open pipeline:
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (711) open OpenCV | GStreamer warning: Error opening bin: could not link v4l2src0 to nvvconv0, v4l2src0 can’t handle caps video/x-raw(memory:NVMM), width=(int)1600, height=(int)1300, format=(string)GRAY8, framerate=(fraction)30/1
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Any ideas? I am lost…
regads,
Magnus