Hi, i’ve got an application written in C++ that streams frames to a Windows machine via UDP. I do this using GStreamer. This works correctly doing it directly in the Jetson AGX Xavier, by using the following pipeline:
std::string gst_out = "appsrc ! video/x-raw, format=BGR ! queue ! videoconvert ! video/x-raw, format=RGBA "
"! nvvidconv ! video/x-raw(memory:NVMM), width=640, height=480 ! omxh264enc insert-vui=true insert-sps-pps=1 "
"! h264parse ! rtph264pay config-interval=1 ! udpsink host=172.16.x.x port=10000 ";
cv::VideoWriter writer;
writer.open(gst_out, cv::CAP_GSTREAMER, 0, 60, cv::Size(640, 480 ), true);
if (!writer.isOpened()) {
printf("=ERR= can't create video writer\n");
return -1;
}
I created a CUDA-Docker container using “FROM nvcr.io/nvidia/l4t-base:r32.4.3” as the base, installed OpenCV 4.5.3 and GStreamer, and replicated the application I mention above, with the same code.
However, when running it in the Docker container, when opening the VideoWriter, I get the following error, when checking the “writer.isOpened()”: =ERR= can’t create video writer
I checked if GStreamer was working by using the following in the cmd:
gst-launch-1.0 videotestsrc ! nvvidconv ! "video/x-raw(memory:NVMM), width=640, height=480, framerate=60/1" ! omxh264enc insert-vui=true insert-sps-pps=1 ! h264parse ! rtph264pay config-interval=1 ! udpsink host=172.16.x.x port=10000
This works in both the Jetson AGX Xavier (Linux) and the CUDA-Docker container.
I compiled OpenCV in the Container with the following flags:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D WITH_CUDA=OFF \
-D ENABLE_CXX11=ON \
-D BUILD_opencv_legacy=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-D WITH_GSTREAMER=ON \
-D WITH_GSTREAMER_0_10=OFF \
-D WITH_FFMPEG=ON ..
Does anybody know if I’m missing something that must be done (in the Container) so this works?