I have a Ximea xiC USB3 camera that I want to use to record high speed (150 fps) videos with my Jetson TX2. I have managed with the help of Ximeas examples to make a code that reads the camera and sends images to zerocopy memory. From there the GpuMat is created and rendered to imshow with OpenGL. Works beautifully!
The problem is that I want to write the stream to a video file. OpenCV built-in videoWriter does not work directly with GpuMat in linux. So the only way to do this is, if I have understood correctly, is to use Gstreamer inside videoWriter with Mat (so I convert the GpuMat to Mat before making video). Problem is that when running my program I get the following errors:
OpenCV: FFMPEG: tag 0x00000000/'????' is not supported with codec id 14 and format 'mp4 / MP4 (MPEG-4 Part 14)' (openCVDemosaic:6610): GStreamer-CRITICAL **: 22:39:53.697: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed (openCVDemosaic:6610): GStreamer-CRITICAL **: 22:39:53.783: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed [ WARN:0] global /home/nvidia/dan/installOCV411/opencv-4.1.1/modules/videoio/src/cap_gstreamer.cpp (1422) open OpenCV | GStreamer warning: error opening writer pipeline: syntax error
My videoWriter code:
char* outputPipe = "appsrc ! 'video/x-raw, format=(string)GRAY8, width=(int)1936, height=(int)1216' ! omxh264enc ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! qtmux ! filesink location=test.mp4"; cv::VideoWriter writer(outputPipe, 0, (float)FPS, cv::Size(width,height));
I suppose there is something wrong with my Gstreamer pipeline. What could that be?
My system is Jetson TX2 with the latest Jetpack. OpenCV 4.1.1 with QT4