I have a Jetson Nano with a Camera, and I have implemented a face detection program. I am streaming the results of the face detection to a connected screen using OpenCV, but I would also like to send it to a webpage. I am using rtmpsink (using gstreamer) to create the stream, and using OpenCV Videowriter to write image frames (Opencv Mats) on the stream. The problem is the delay (about 4 seconds) between the video on the screen and the video on the webpage. Is this due to encoding or videowriter? What can I do to reduce it?
My code is :
writer.open("appsrc ! videoconvert ! video/x-raw,format=I420 ! omxh264enc ! video/x-h264,stream-format=(string)byte-stream,alignment=(string)au ! h264parse ! queue ! flvmux ! rtmpsink location=rtmp://localhost:1935/live/ ", 0, (double)30, cv::Size(640, 480), true);
writer << IMG_STREAM;
I already did sudo nvpmodel -m 0 & sudo jetson_clocks